#### Archived

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

# does the order of the Matrixtransforms matter?

This topic is 5980 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 on other sites

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 on other sites
thanks, that helps a TON

##### Share on other sites
quote:
Original post by a person

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

1. 1
2. 2
3. 3
Rutin
19
4. 4
khawk
14
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633657
• Total Posts
3013200
×