does the order of the Matrixtransforms matter?

Started by
3 comments, last by billybob 21 years, 8 months ago
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?
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.
thanks, that helps a TON
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
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?
I'm interested in full featured 3D system development.

This topic is closed to new replies.

Advertisement