Archived

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

billybob

does the order of the Matrixtransforms matter?

Recommended Posts

if i translateda mesh, rotated it, and then translated it to a position, would it move the mesh to the new position, rotate it around that position, and then move it to the final location? or does it all get added together? like it would just do the rotation, and the translate 1 + translate 2?

Share this post


Link to post
Share on other sites
ignore the previous post, he did not read your question.

the order matters. if you translate then rotate then translate

FinalMatrix = Trans1 * Rot1 * Trans2;

if you want yoru second example you must do
FinalMatrix = Rot1 * Trans1 * Trans2;

means you translate the object then rotate the object then translate it again. this is important to know otherwise you will confuse things greatly. i suggest reading about matrix math. also matrices NEVER get added when you combine them. you multiply them. this is a VERY important distinction since if you add matrices it wont work at all.

Share this post


Link to post
Share on other sites
quote:
Original post by a person
ignore the previous post, he did not read your question.

the order matters. if you translate then rotate then translate

FinalMatrix = Trans1 * Rot1 * Trans2;

if you want yoru second example you must do
FinalMatrix = Rot1 * Trans1 * Trans2;

means you translate the object then rotate the object then translate it again. this is important to know otherwise you will confuse things greatly. i suggest reading about matrix math. also matrices NEVER get added when you combine them. you multiply them. this is a VERY important distinction since if you add matrices it wont work at all.



Wouldn´t that do what I said? Add every amtrix together and THEN make changes to the mesh?





http://www.shakazed.tk

Share this post


Link to post
Share on other sites
In case of orthogonal matrices it doesn''t matter.

O1xO2 == O2xO1 , O1, O2 are orthogonal matrices

For example the rotation order is indifferent.
Am I right?

Share this post


Link to post
Share on other sites