#### Archived

This topic is now archived and is closed to further replies.

# 4th column in matrix??

This topic is 5780 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Can anyone tell me what the 4th column in a 4x4 matrix is used for? Can''t seem to find an answer.

##### Share on other sites
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

##### Share on other sites
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.

1. 1
Rutin
42
2. 2
3. 3
4. 4
5. 5

• 9
• 27
• 20
• 9
• 15
• ### Forum Statistics

• Total Topics
633392
• Total Posts
3011639
• ### Who's Online (See full list)

There are no registered users currently online

×