Skip to main content
GameDev.net gamedev.net
🔒 Locked

Matrix multiplication order

Started by ByteMe95 Oct 23, 2001 at 2:32 PM 0 replies 550+ views
Original Post
ByteMe95
ByteMe95
Ok, I have a lot of matrices that need to be combined in order to get my final transform matrix of an object. I have to do a translation then a Quaternion axis+angle rotation matrix then a possible scaling then I have to throw in the current world transform matrix which is user controlled (for rotations, zoom in/out) and throw it in. The question is, what the heck is ordering based on can I can clearly see that the outcome is different depending on what order I do everything, so is there some kind of general rule or something? ByteMe95::~ByteMe95() Cerebrum Software
ByteMe95::~ByteMe95()My S(h)ite
Catfang
Catfang
Do everything backwards in order from the final matrix. If you want to do the following in this order:
[1] translation
[2] rotation
[3] scale
[4] view

then it computed by [3][2][1][4].

Just write the code backwards (up) from the final matrix.

Hope this helps.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.