Instance Property

pivot

The pivot point for the node’s position, rotation, and scale. Animatable.

Declaration

@property(nonatomic) SCNMatrix4 pivot;

Discussion

A node’s pivot is the transformation between its coordinate space and that used by its position, rotation, and scale properties. The default pivot is SCNMatrix4Identity, specifying that the node’s position locates the origin of its coordinate system, its rotation is about an axis through its center, and its scale is also relative to that center point.

Changing the pivot transform alters these behaviors in many useful ways. You can:

  • Offset the node’s contents relative to its position. For example, by setting the pivot to a translation transform you can position a node containing a sphere geometry relative to where the sphere would rest on a floor instead of relative to its center.

  • Move the node’s axis of rotation. For example, with a translation transform you can cause a node to revolve around a faraway point instead of rotating around its center, and with a rotation transform you can tilt the axis of rotation.

  • Adjust the center point and direction for scaling the node. For example, with a translation transform you can cause a node to grow or shrink relative to a corner instead of to its center.

You can animate changes to this property’s value. See Animating SceneKit Content.

See Also

Managing the Node’s Transform (SceneKit Types)

transform

The transform applied to the node relative to its parent. Animatable.

position

The translation applied to the node. Animatable.

rotation

The node’s orientation, expressed as a rotation angle about an axis. Animatable.

eulerAngles

The node’s orientation, expressed as pitch, yaw, and roll angles in radians. Animatable.

orientation

The node’s orientation, expressed as a quaternion. Animatable.

scale

The scale factor applied to the node. Animatable.