SceneSpec
SceneSpec is a tagged union: LottieSpec | ThreeSpec,
discriminated by kind.
Shared fields¶
idstring, required- Stable identifier. Used for routes and caching.
kind"lottie" | "three", required- Selects the renderer.
titlestring- Human label.
descriptionstring- One-line description.
width,heightnumber- Suggested render box, in pixels. CSS still controls layout.
backgroundstring- CSS background behind the canvas. Default transparent.
LottieSpec¶
kind: "lottie".
dataLottieDocument, required- A full Lottie JSON document. Required numeric fields:
fr,ip,op,w,h;layersmust be an array. loopboolean- Default
true. autoplayboolean- Default
true. speednumber- Playback multiplier. Default
1.
ThreeSpec¶
kind: "three".
cameraThreeCamerafov(deg, default 50),position(Vec3, default[0,0,5]),lookAt(Vec3, default[0,0,0]).objectsThreeObject[], required- Each:
name,geometry, optionalmaterial,position,rotation(Vec3),scale(Vec3 or number). lightsThreeLight[]- Defaults to one ambient + one directional if omitted.
animateThreeAnimation[]- Per-frame directives, applied by
targetname. envobjectbackground(hex string),autoRotate(radians/sec on the whole scene).
geometry.type¶
| type | fields |
|---|---|
box | size: Vec3 |
sphere | radius, segments |
torus | radius, tube, segments |
torusKnot | radius, tube, p, q |
plane | width, height |
cone | radius, height, segments |
icosahedron | radius, detail |
points | count, spread, size |
material.type¶
standard- PBR, lit.
color,emissive,emissiveIntensity,metalness,roughness,opacity,wireframe. basic- Unlit flat colour.
normal- Debug normals.
points- For
pointsgeometry.
light.type¶
ambientcolor,intensity.directionalcolor,intensity,position.pointcolor,intensity,position.
animate properties¶
rotationaxis: "x"|"y"|"z",speed: radians/sec.bobamplitude: world units,speed: oscillations/sec, optionalaxis.pulseamplitude: fraction of base scale,speed.