Creates a UV sphere mesh primitive (radius 1, centered at origin, smooth shading).
Takes textureSlots, uvMode, unique, segments (horizontal/vertical 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 UV sphere mesh primitive (radius 1, centered at origin, smooth shading).
Takes textureSlots, uvMode, unique, segments (horizontal/vertical subdivision count, clamped 3-128).
Returns mesh entity handle or 0 on failure.
Technical Exegesis...
Creates a UV sphere mesh primitive (radius 1, centered at origin, smooth shading). Takes textureSlots, uvMode, unique, segments (horizontal/vertical subdivision count, clamped 3-128). Returns mesh entity handle or 0 on failure. Creates surface-based mesh, adds top/bottom pole vertices, generates ring vertices using spherical coordinates (latitude/longitude), sets normals equal to positions (unit sphere property), adds triangles for top cap, body, bottom cap, unlocks. Sphere radius: 1.
Creates a UV sphere mesh primitive (radius 1, centered at origin, smooth shading). Takes textureSlots, uvMode, unique, segments (horizontal/vertical subdivision count, clamped 3-128). Returns mesh entity handle or 0 on failure. Creates surface-based mesh, adds top/bottom pole vertices, generates ring vertices using spherical coordinates (latitude/longitude), sets normals equal to positions (unit sphere property), adds triangles for top cap, body, bottom cap, unlocks. Sphere radius: 1.0 unit, extends from (-1,-1,-1) to (+1,+1,+1). Returns mesh entity handle.
This function creates UV-mapped sphere for planets, balls, and round objects. UV sphere: horizontal segments (longitude slices) and vertical rings (latitude bands). Segments parameter: controls both horizontal and vertical detail - segments=16 creates 16x8 grid (horizontalxvertical). Higher segments = smoother sphere but more triangles. Clamped range: 3 minimum (crude icosahedron-like), 128 maximum (very smooth, high poly). Smooth shading: shared vertices between triangles, normals averaged automatically for smooth appearance. UV mapping: latitude/longitude projection (0-1 U wraps around equator, 0-1 V from pole to pole). Use cases: (1) Planets/moons (celestial bodies), (2) Balls/spheres (sports, physics), (3) Particle systems (round particles), (4) Dome structures (sky dome, radar dome), (5) Character heads (base mesh). Common pattern: sphere=b3dCreateSphere(BBR_ONE_SLOT, BBR_TEXTURE_UV, 0, 32), b3dScaleEntity(sphere, r, r, r) for custom radius. Topology: pole vertices (top/bottom singularity), ring vertices, triangle fans at poles, quad strips for body. Normals: point outward from center (position = normal for unit sphere). Vertex count: approximately segments x (segments/2) vertices. Triangle count: approximately segments x segments triangles. segments=16: ~128 vertices, ~256 triangles. segments=32: ~512 vertices, ~1024 triangles. Performance vs quality tradeoff: low segments (8-16) for distant objects, high segments (32-64) for close-up. Alternative: b3dCreateCube for box shapes, b3dLoadMesh for custom models, icosphere for more uniform triangulation. Modification: fully editable (surface-based mesh).