3D Primitives
Two built-in solids — the same two Processing itself ships as core 3D primitives. Both are centered on the current origin, filled with the current Fill() color, and shaded by the active lights (flat and fully unlit if Lights() hasn't been called — Processing's own default too).
On this page · 3 entries
Box
Box(float size)Box(w, h, d)
A cube (or box) centered on the origin. Box(size) is a shortcut for Box(size, size, size).
Sphere
Sphere(float radius)
A sphere centered on the origin, meshed at the resolution set by the last SphereDetail() call (default 30×30).
SphereDetail
SphereDetail(int res)SphereDetail(ures, vres)
Sets the sphere mesh resolution for Sphere() calls made after this one — res segments both around the equator and pole-to-pole, or independently via ures/vres. Values below 3 are clamped up to 3. Applied lazily: the mesh is only rebuilt the next time Sphere() actually runs, so calling this repeatedly (or never calling Sphere() at all) never touches the GPU for nothing.