Jump to content
  • Advertisement

Archived

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

billybob

does the order of the Matrixtransforms matter?

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

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
Advertisement
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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!