Skip to content
Part IA Michaelmas Term

3D Transformation Matrices

Identity

[1000010000100001]\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}

Scale (uniform, factor mm)

[m0000m0000m00001]\begin{bmatrix} m & 0 & 0 & 0 \\ 0 & m & 0 & 0 \\ 0 & 0 & m & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}

For non-uniform scaling, use different values on the diagonal.

Translate (by (tx,ty,tz)(t_x, t_y, t_z))

[100tx010ty001tz0001]\begin{bmatrix} 1 & 0 & 0 & t_x \\ 0 & 1 & 0 & t_y \\ 0 & 0 & 1 & t_z \\ 0 & 0 & 0 & 1 \end{bmatrix}

Rotation Matrices

Rotate about x-axis

Rx(θ)=[10000cos⁡θ−sin⁡θ00sin⁡θcos⁡θ00001]\mathbf{R}_x(\theta) = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & \cos\theta & -\sin\theta & 0 \\ 0 & \sin\theta & \cos\theta & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}

Rotate about y-axis

Ry(θ)=[cos⁡θ0sin⁡θ00100−sin⁡θ0cos⁡θ00001]\mathbf{R}_y(\theta) = \begin{bmatrix} \cos\theta & 0 & \sin\theta & 0 \\ 0 & 1 & 0 & 0 \\ -\sin\theta & 0 & \cos\theta & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}

Rotate about z-axis

Rz(θ)=[cos⁡θ−sin⁡θ00sin⁡θcos⁡θ0000100001]\mathbf{R}_z(\theta) = \begin{bmatrix} \cos\theta & -\sin\theta & 0 & 0 \\ \sin\theta & \cos\theta & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}

Mnemonic

The axis being rotated about has 1 on the diagonal and 0 in that row/column. The other entries form a 2D rotation matrix.

Non-Commutativity

3D rotations are non-commutative:

  • Rx(90°)⋅Rz(90°)≠Rz(90°)⋅Rx(90°)\mathbf{R}_x(90°) \cdot \mathbf{R}_z(90°) \neq \mathbf{R}_z(90°) \cdot \mathbf{R}_x(90°)

Cube showing different orientations from different rotation orders

Summary

  • Translation uses the fourth column
  • Rotation matrices are orthogonal (determinant = 1)
  • 3D rotations are non-commutative