2 ms·
To add to the explanations already given here, the way I think of it as a non-maths person is: A matrix represents a transform of the form: x' = Ax + By +
by rogual 4y ago
To add to the explanations already given here, the way I think of it as a non-maths person is:
A matrix represents a transform of the form:
x' = Ax + By + Cz
y' = Dx + Ey + Fz
z' = Gx + Hy + Iz
...the A...I letters being the elements of the 3x3 matrix. (If you squint you can see the matrix above).
Although this can represent scales and rotations, there's no way to represent a simple translation with this.
As proof, imagine you want to move everything 3 units along the x axis. You really just want to add 3 to x (x' = x + 3) but you can't: x' is always defined in terms of x, y and z (x' = Ax + By + Cz). There's no room for a constant.
To represent translations, then, what you really want is (x' = Ax + By + Cz + D), where D isn't multiplied by any component of the input vector, it's just D, your translation.
Well, it turns out you can do this by just adding an extra column to the matrix and using 1 for the fourth component of your vectors.
Now x' = Ax + By + Cz + Dw, where w=1, and D is your translation amount.
The full matrix then becomes
x' = Ax + By + Cz + Dw
y' = Ex + Fy + Gz + Hw
z' = Ix + Jy + Kz + Lw
w' = Mx + Ny + Oz + Pw
You can see how (D, H, L) now functions as a translation vector.