Sphere
The Sphere is a 3D primitive generated from configurable ring and segment counts. Higher values produce smoother surfaces at the cost of more faces. Like all 3D shapes, it supports positioning, rotation, and automatic flat shading.
NOTE
For the full API, see the 3D API Reference.
Demo
Usage
ts
import {
createSphere,
} from '@ripl/3d';
const sphere = createSphere({
radius: 1,
segments: 16,
rings: 12,
fill: '#44cc88',
});Properties
radius— Radius of the spheresegments— Number of horizontal segments (default16)rings— Number of vertical rings (default12)x/y/z— Position in world space (default0)rotationX/rotationY/rotationZ— Rotation around each axis in radians (default0)