# combining rotations ... sort of

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

## Recommended Posts

Hello all, another question for the 3d maths genii... Situation: -I have objects, that are joined by "connection points" -Each connection point is described by an offset from the center of the object, and a vector for the direction of the connection -connected objects have a single "rotation" value, that describes how far the connected object is rotated about the connection Now, when I attach many objects together first, I can apply "rotations about the connection" to any connection, and propagate this back along any connected items, and this works fine. However, if I attach a new object to other objects that are already connected, and already have rotations about their respective connection points, I need the newly connected piece to somehow inherit these parent rotations... however, as each connection point is in an arbiratry direction and at an arbitrary angle.. i'm lost as to the best method to achieve this. to describe my issue visually, see: http://markus.orcon.net.nz/cubes2.jpg in each picture, the bottom cube is the base block, and has no rotation applied to it. in figure 1, two child blocks are attached via connection points. in figure 2, the middle block has then been rotated 45 degrees, counter clockwise, and the rotation has propagated to the top most block (correct scenario) however, in figure 3, what I did was, attach the third block (top most) block AFTER applying the 45 degrees rotation to the middle block (the second block attached). note the difference (see http://markus.orcon.net.nz/cubes3.jpg for a top down view) now, one way to achieve consistent results would be, to "unwind" all the parent connection point rotations, attached the new object, then re-apply each parent rotation, but that seems awfully tedious... is there another way to achieve this? Thanks in advance Markus

##### Share on other sites
When connecting new objects: rotate them first, then connect (translate) them...

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 28
• 16
• 10
• 10
• 11
• ### Forum Statistics

• Total Topics
634111
• Total Posts
3015573
×