Jump to content

From relative rotation to absolute rotation


Maegfaer

Recommended Posts

I have been trying to solve this problem for two days now, but can't figure it out. Maybe a kind soul can help me. :wink:

 

All of this is in Euler notation. In truth, I only heard about Quaternions yesterday and still don't understand them fully, and I never worked with rotation matrices before. :sad:

 

Imagine two objects in the game. Let's call the first object the independent object, and the second the dependent object. The independent object is at a set point in space, but it can rotate horizontally (Euler z-rotation). The dependent object should 'follow' the the independent object when it rotates, so that the relative position and rotation of the dependent object always stays the same. I have the relative position and rotation numbers available (in Euler notation), and I need to convert those to the absolute position and rotation values for any given Z (horizontal) rotation of the independent object.

 

For the position it was easy, it was a matter of measuring the distance between the two objects, and then use sine and cosine with the z-rotation of the independent object to calculate the new x-y-z coordinates.

 

I am stuck with the rotations however. Because, for example, x-rot=30, y-rot=50, z-rot=0 does not have the same relative rotation as x-rot=30, y-rot=50, z-rot=45. Changing the z-rotation requires the x-rotation and y-rotation to change as well, if you want to keep the same relative rotation. This is just how the Euler notation system works right?

 

So like the title says, I need to convert the relative rotation of the dependent object to absolute rotation, where the z-rotation of the independent object is variable. I think it's similar to a satellite situation?

 

I DO have the relative rotation values available in Quaternion as well, but like I said, I don't understand them. Telling me to multiply two Quaternions with different rotation values (or something like that) doesn't really help, because I have no idea how to do that, unless the steps are explained in detail.

 

So if possible, can you tell me how to do it all in Euler notation?

 

 

Thank you very much in advance!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...