eulerAngles
instance property is used for node’s orientation, expressed as pitch
, yaw
, and roll
angles in radians.
var eulerAngles: SCNVector3 { get set }
The order of components is as following:
- Pitch (
X
component) is the rotation about the node’s X
-axis
- Yaw (
Y
component) is the rotation about the node’s Y
-axis
- Roll (
Z
component) is the rotation about the node’s Z
-axis
To use eulerAngles
instance property is much simpler than using Rotation 4
x4
Matrix. ARKit and SceneKit frameworks use 4
x4
Transformation Matrices to translate, rotate, scale and shear 3D objects. Let's see how they work:
The Identity 4
x4
Matrix has 16 elements inside:

Between those sixteen elements there are 6 different shearing coefficients:
shear XY
shear XZ
shear YX
shear YZ
shear ZX
shear ZY
In Shear Matrix they are as followings:

Because there are no Rotation coefficients
at all in this Matrix, six Shear coefficients
along with three Scale coefficients
allow you rotate 3D objects about X
, Y
, and Z
axis using magical trigonometry (sin
and cos
).
Here's an example how to rotate 3D object (CCW) about its Z
axis using Shear and Scale elements:

Look at 3 different Rotation patterns (Pitch, Yaw, and Roll) using Shear and Scale elements:

Translation 4
x4
Matrix looks like this:

Hope this helps.