Skip to content

Coordinate systems ​

Understanding coordinate space is essential for pivots and animations.

Imported model-local space ​

pivot.point is stored in the original model's local coordinate system, before Model Lab's pivot offset and outer model transform.

Pivot-root space ​

model.position, model.rotation, and model.scale are applied to the pivot root. Rotation values are degrees in exported JSON and public component props.

World space ​

Camera position, camera target, helper positions, and renderer output exist in world space.

Pivot hierarchy ​

text
model-lab-pivot-root
  position / rotation / scale
  └─ model-lab-content-root
       position = -pivot.point
       └─ imported glTF scene

This hierarchy means the point stored as pivot.point is moved to the pivot root's origin. Rotation and scale then happen around that point.

Converting a picked world point ​

Use worldPointToModelLocal() when a raycast gives a world-space intersection:

ts
const localPoint = worldPointToModelLocal(
  worldIntersection,
  modelContentRoot,
)

Degrees and radians ​

The public configuration uses degrees for readability. Internally, Model Lab converts to radians when setting Three.js Euler rotations.

Released under the MIT License.