Creates a cube mesh primitive (2x2x2, centered at origin, flat shading).
Takes textureSlots (BBR_ONE_SLOT to BBR_FOUR_SLOT), uvMode (BBR_TEXTURE_UV or BBR_NO_TEXTURE_UV), unique (unused, Blitz3D compatibility).
Returns mesh entity handle or 0 on failure.
3D Graphics
Parameters & Returns
Parameters
textureSlotsInt
uvModeInt
uniqueInt
Returns
Int
Quick Summary
Creates a cube mesh primitive (2x2x2, centered at origin, flat shading).
Takes textureSlots (BBR_ONE_SLOT to BBR_FOUR_SLOT), uvMode (BBR_TEXTURE_UV or BBR_NO_TEXTURE_UV), unique (unused, Blitz3D compatibility).
Returns mesh entity handle or 0 on failure.
Technical Exegesis...
Creates a cube mesh primitive (2x2x2, centered at origin, flat shading). Takes textureSlots (BBR_ONE_SLOT to BBR_FOUR_SLOT), uvMode (BBR_TEXTURE_UV or BBR_NO_TEXTURE_UV), unique (unused). Returns mesh entity handle or 0 on failure. Creates surface-based mesh via b3dCreateMesh, locks, creates single surface, adds 24 vertices (4 per face, duplicated for flat shading), adds 12 triangles (2 per face), sets face normals (perpendicular to each face), unlocks.
Creates a cube mesh primitive (2x2x2, centered at origin, flat shading). Takes textureSlots (BBR_ONE_SLOT to BBR_FOUR_SLOT), uvMode (BBR_TEXTURE_UV or BBR_NO_TEXTURE_UV), unique (unused). Returns mesh entity handle or 0 on failure. Creates surface-based mesh via b3dCreateMesh, locks, creates single surface, adds 24 vertices (4 per face, duplicated for flat shading), adds 12 triangles (2 per face), sets face normals (perpendicular to each face), unlocks. Cube dimensions: extends from (-1,-1,-1) to (+1,+1,+1) in model space = 2 units per axis. Returns mesh entity handle.
This function creates ready-to-use cube geometry for primitive shapes and placeholders. Cube structure: 6 faces (front, back, left, right, top, bottom), 24 vertices total (no shared vertices between faces for hard edges), 12 triangles (2 per face). Flat shading: each face has 4 duplicate vertices with same position but face-specific normal - creates sharp edges instead of smooth corners. UV mapping: each face mapped to full 0-1 texture range (cube unwrap pattern). Normals pre-calculated: Front=(0,0,1), Back=(0,0,-1), Right=(1,0,0), Left=(-1,0,0), Top=(0,1,0), Bottom=(0,-1,0). Winding order: CCW when viewed from outside. Use cases: (1) Placeholders (test geometry, bounding box visualization), (2) Building blocks (voxel systems, Minecraft-style worlds), (3) Dice/boxes (game objects), (4) Level geometry (rooms, platforms), (5) Collision proxies. Common pattern: cube=b3dCreateCube(BBR_ONE_SLOT, BBR_TEXTURE_UV, 0), b3dPositionEntity(cube, x, y, z), b3dScaleEntity(cube, sx, sy, sz) for non-uniform dimensions. textureSlots: determines UV channel count (BBR_ONE_SLOT=base texture only), uvMode: BBR_TEXTURE_UV includes UVs, unique parameter ignored (retained for API compatibility). Alternative: b3dLoadMesh for custom models, b3dCreateMesh for custom shapes. Modification: cube fully editable (surface-based) - can lock, modify vertices, unlock. Typical workflow: create -> position -> scale -> texture -> render. Dimensions customizable: scale by 0.5 for 1x1x1 cube, scale by 2 for 4x4x4. Performance: 24 vertices, 12 triangles - lightweight for rendering.