<sk-orbit-constraint>

← prev index next →

Revolves a node around a pivot at a fixed radius by azimuth and elevation — the way to put an object (or a camera) on a controllable orbit.

Remarks

This is the orbiting member of the Constraint family: like every constraint it drives its constrained target by recomputing from live scene state each frame — here it places the target on a sphere around a pivot from spherical angles, so animating one angle sweeps a smooth revolution. The orbit parameters live on the constraint itself, or come from a separate Orbit node so several targets share one orbit definition (and its sk-orbit visualization).

Key attributes. radius is the orbit distance from the pivot. azimuth sweeps around the vertical axis and elevation tilts above/below the horizontal plane; both are angles and both are animatable, so sweeping azimuth through a full turn produces a continuous orbit. orient-toward-pivot additionally turns the target to face the pivot. Two further options refine it: orientation-axis chooses which local axis points inward when orienting (default -z), and min-radius clamps how close the orbit may pull in.

Related. Pairs with the sk-orbit support node (which holds shared orbit parameters and can draw the ring) and its class Orbit. Sibling constraints in the Constraint family include sk-align-to-spline-constraint (follow an arbitrary path) and sk-target-at-constraint (aim at a node); the GPU-parallel PointConstraint applies per-clone effects across a Cloner.

Serve these docs to run the live example. WebGPU needs a secure context — open this page via grunt serve rather than double-clicking the file. The Markup tab works from disk.

Attributes

AttributeTypeDefaultDescription
pivot <id-ref> Pivot the node orbits around — an element id reference (#id) of a node to track.
radius <number> 0 Distance from the pivot point.
azimuth <angle> 0 Horizontal angle around the Y axis (radians).
elevation <angle> 0 Vertical angle from the XZ plane (radians).
min-radius <number> Minimum orbit radius the controller will zoom to.
orient-toward-pivot <boolean> false Whether to orient the node to face the pivot.
orientation-axis <orientation-axis> ("+x" | "-x" | "+y" | "-y" | "+z" | "-z") "-z" Axis that points toward the pivot when orientTowardPivot is true.