# Combine Rotations

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

## Recommended Posts

Hey there, im new to the whole game-math. I got an issue now where you guys will propably be able to help me out. I got a WorldPosition-class which holds the pos-data for my objects in the worldspace. This includes 2 Vector3's for rotation and translation as well as Matrices for rotation/translation. Now i build a hierarchy of such worldposition so any movement/rotation of an object will result in changes of any sub-item. Thus a rotation of an object around its center will lead to a rotation of the subitem around the center of the parentitem. Now to the point..the worldpos-instances generates a matrix or all translations/rotations done to the object. This will used as device.Transform.xx when the item is rendered. Thats the idea but im unable to manage it. I just dont know how to merge the Pivot-Rotation (Move world to inverse of Pivot-Pnt, Rotate, Mode world to Pivot-Pnt again). I mean how can i save the pivot-rotation in one matrix together with the other translations ? Ah well i know its not this good described..i hope you get my point. Thanks alot for the help! oliver

##### Share on other sites
Combining two transformations mean multiplying their transformation matrices together. Depending on whether you're using OpenGL or DirectX (one is row-major and the other column-major), you will either want to multiply 'up the stack' (final matrix = local transform * parent transform * ... * world transform) or 'down the stack' (final matrix = world transform * ... * group transform * leaf transform).

##### Share on other sites
Quote:
 Original post by Bob JanovaCombining two transformations mean multiplying their transformation matrices together. Depending on whether you're using OpenGL or DirectX (one is row-major and the other column-major), you will either want to multiply 'up the stack' (final matrix = local transform * parent transform * ... * world transform) or 'down the stack' (final matrix = world transform * ... * group transform * leaf transform).

ah ok...thanks for the help. Will try that out...

1. 1
2. 2
3. 3
4. 4
Rutin
18
5. 5

• 11
• 22
• 12
• 12
• 11
• ### Forum Statistics

• Total Topics
631406
• Total Posts
2999903
×