Sphere
A 3D sphere generated from configurable ring and segment counts.
Usage
ts
import { createSphere } from '@ripl/3d';
const sphere = createSphere({
radius: 1,
segments: 16,
rings: 12,
fillStyle: '#44cc88',
});Properties
| Property | Type | Default | Description |
|---|---|---|---|
radius | number | — | Radius of the sphere |
segments | number | 16 | Number of horizontal segments |
rings | number | 12 | Number of vertical rings |
x | number | 0 | X position |
y | number | 0 | Y position |
z | number | 0 | Z position |
rotationX | number | 0 | Rotation around X axis (radians) |
rotationY | number | 0 | Rotation around Y axis (radians) |
rotationZ | number | 0 | Rotation around Z axis (radians) |