Jump to content
  • Advertisement


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.

If you intended to correct an error in the post then please contact us.

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 this post

Link to post
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)

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

Share this post

Link to post
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.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!