The Model Matrix

Move, turn and stretch an object by dragging the numbers that do it, and watch the matrix fill in as you go.

What you should come away with: Why a matrix chain reads right to left, and why the columns are the object’s own axes.

  • X
  • Y
  • Z
drag to orbit

The matrix

T translate
1.000.000.001.40
0.001.000.000.50
0.000.001.000.00
0.000.000.001.00
R rotate
0.910.000.420.00
0.001.000.000.00
-0.420.000.910.00
0.000.000.001.00
S scale
1.000.000.000.00
0.001.000.000.00
0.000.001.000.00
0.000.000.001.00
M = T · R · S
0.910.000.421.40
0.001.000.000.50
-0.420.000.910.00
0.000.000.001.00

The first three columns of M are the cube’s own axes after the transform — that is exactly what the red, green and blue arms on the canvas are drawing. The fourth column, in amber, is where its origin ended up. Drag a translate slider and watch only that column move.