All examples · Meshes and 3D · As Markdown, for AIs

Pivot in 3D

What this example shows

transform.pivot is the point a placement turns and grows about, in its own units from its origin. Setting it moves nothing: only a turn or a growth goes about it, and everything the box holds goes with it.

The two runners are the same box: a body and a head, its origin in its middle. The orange one turns about that middle, so when it trips its feet swing up off the floor. The blue one has pivot: { x: 0, y: -0.8, z: 0 }, its feet, so it falls over them as a body does, with one angle, rotationX, and no quaternions composed by hand. A mesh or a model takes a pivot in its transform too.

Click the preview first so it hears the keyboard. Hold → and ← to lean them forward and back, slowly, and see what each turns about; Space trips them both.

Starting
Starting
—