Creates a cylinder mesh primitive (radius 1, height 2, centered at origin, with top/bottom caps).
Takes textureSlots, uvMode, unique, segments (circular subdivision count, clamped 3-128).
Returns mesh entity handle or 0 on failure.
3D Graphics
Parameters & Returns
Parameters
textureSlotsInt
uvModeInt
uniqueInt
segmentsInt
Returns
Int
Quick Summary
Creates a cylinder mesh primitive (radius 1, height 2, centered at origin, with top/bottom caps).
Takes textureSlots, uvMode, unique, segments (circular subdivision count, clamped 3-128).
Returns mesh entity handle or 0 on failure.
Technical Exegesis...
Creates a cylinder mesh primitive (radius 1, height 2, centered at origin, with top/bottom caps). Takes textureSlots, uvMode, unique, segments (circular subdivision count, clamped 3-128). Returns mesh entity handle or 0 on failure. Creates surface-based mesh, generates top ring vertices (Y=+1), bottom ring (Y=-1), side triangles connecting rings, top cap (center vertex + triangles), bottom cap (center + triangles), sets normals (horizontal for sides, vertical for caps), unlocks.
Creates a cylinder mesh primitive (radius 1, height 2, centered at origin, with top/bottom caps). Takes textureSlots, uvMode, unique, segments (circular subdivision count, clamped 3-128). Returns mesh entity handle or 0 on failure. Creates surface-based mesh, generates top ring vertices (Y=+1), bottom ring (Y=-1), side triangles connecting rings, top cap (center vertex + triangles), bottom cap (center + triangles), sets normals (horizontal for sides, vertical for caps), unlocks. Cylinder dimensions: radius 1, height 2 (Y from -1 to +1). Returns mesh entity handle.
This function creates capped cylinder for columns, pipes, and barrels. Cylinder structure: side wall (vertical surface), top cap (flat circle), bottom cap (flat circle). segments parameter: circular resolution around circumference - segments=16 creates 16-sided cylinder, segments=32 smoother. Clamped 3-128. Smooth sides: vertices shared around circumference for smooth shading. Hard edge at caps: duplicate vertices at cap/side junction for sharp crease. UV mapping: side wall wraps texture horizontally (U=angle), vertically (V=height), caps use radial UV (centered circle). Use cases: (1) Columns/pillars (architecture), (2) Pipes/tubes (plumbing, cables), (3) Barrels/drums (containers), (4) Tree trunks (nature), (5) Wheels/gears (circular extrusion). Common pattern: cyl=b3dCreateCylinder(BBR_ONE_SLOT, BBR_TEXTURE_UV, 0, 24), b3dScaleEntity(cyl, r, h/2, r) for radius r, height h. Normals: side normals point outward horizontally, top cap points up (0,1,0), bottom points down (0,-1,0). Vertex count: ~3xsegments (side rings + cap centers + duplicates). Triangle count: ~4xsegments (sides + two caps). segments=16: ~48 vertices, ~64 triangles. segments=32: ~96 vertices, ~128 triangles. Performance: lower segments (8-12) for simple shapes, higher (24-48) for smooth appearance. Alternative: b3dCreateCone for tapered, b3dCreateCapsule for rounded ends, extrude circle for custom profile. Capped vs uncapped: includes both caps (closed cylinder), not hollow. Modification: surface-based, fully editable. Typical height: 2 units default, scale Y for custom height.