4th column in matrix??

Started by
1 comment, last by RavNaz 21 years, 3 months ago
Can anyone tell me what the 4th column in a 4x4 matrix is used for? Can''t seem to find an answer.
Advertisement
the 4th colum for 3D transformation matrix, is to do translation. For other transformations like rotation, scaling etc all that is needed is multiplication e.g. Scale
x''=x * sX
y''=y * sY
z''=z * sZ

but a translation consists of a addition ( if value is negative a subtraction ) and because of the mechanics of matrix multiplication they can''t be applied. So the 4th column is used for translation. The 4th componet of a vector is set to 1 to allow translation.Ill give a example of 2D vectors & therfore 3x3 matrices of translation. Ill translate the vector by (4,2)

(2,3,1) x (1,0,0)
(0,1,0)
(4,2,1)

x'' = (2 * 1 ) + (0 * 3) + (1 * 4 ) = 6 // correct
y'' = (0 * 2 ) + (1 * 3) + (1 * 2 ) = 5 // correct

the next column doesn''t really matter unless your doing some sort of projection matrix. The important part of the example is the brackets at the end which actully do the translation

hope this helped
Iain
who is it that keeps on nicking WizHarD name !! :P
It all depends on if the matrix is row major or column major. I''m assuming you''re talking about row major because the last column is hardly ever discussed anywhere. As far as I know the last column is for skewing your model. From top to bottom the skewing is x, y and z.

OpenGL uses column major, but whenever I read about matrices they''re row major...go figure.

This topic is closed to new replies.

Advertisement