Structure

SCNMatrix4

A representation of a 4 x 4 matrix.

Declaration

iOS, Mac Catalyst, tvOS, watchOS
typedef struct SCNMatrix4 {
    ...
} SCNMatrix4;
macOS
typedef CATransform3D SCNMatrix4;

Overview

SceneKit uses matrices to represent coordinate space transformations, which in turn can represent the combined position, rotation or orientation, and scale of an object in three-dimensional space.

Topics

Creating Transform Matrices

SCNMatrix4MakeTranslation

Returns a matrix describing a translation transformation.

SCNMatrix4MakeRotation

Returns a matrix describing a rotation transformation.

SCNMatrix4MakeScale

Returns a matrix describing a scale transformation.

Performing Matrix Operations

SCNMatrix4Translate

Returns a new matrix created by concatenating the specified matrix with a translation transformation.

SCNMatrix4Rotate

Returns a new matrix created by concatenating the specified matrix with a rotation transformation.

SCNMatrix4Scale

Returns a new matrix created by concatenating the specified matrix with a scale transformation.

SCNMatrix4Invert

Returns the inverse of the specified matrix.

SCNMatrix4Mult

Returns the product of two matrices.

Converting Matrix Types

SCNMatrix4FromGLKMatrix4

Returns a SceneKit matrix corresponding to a GLKit matrix.

SCNMatrix4ToGLKMatrix4

Returns a GLKit matrix corresponding to a SceneKit matrix.

Comparing Matrices

SCNMatrix4EqualToMatrix4

Returns a Boolean value that indicates whether the corresponding elements of two matrices are equal.

SCNMatrix4IsIdentity

Returns a Boolean value that indicates whether the specified matrix is equal to the identity matrix.

Identity Constant

SCNMatrix4Identity

The 4 x 4 identity matrix.

See Also

Transforms and Rotations

SCNQuaternion

A representation of a quaternion.