Archived

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

Matrix multiplication order

This topic is 5900 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

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites