Jump to content
  • Advertisement
Sign in to follow this  
Dirk Gregorius

Relative quaternion

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am looking for the relative rotation quaternion bewteen two orientations. Given: Two unit quaternions q1, q2: Wanted: q_rel Some remarks: (1) The quaternion multiplication is defined in the original form, that is q1 * q2 encodes the rotation q2 followed by q1. E.g. DirectX implements this the other way around in order to stay consistent with the matrix multiplication. (2) The relative orientation should correspond to a relative vector v_rel = v1 - v2. Please note the direction. v_rel points from v2 to v1. What I seek is the relative quaternion q_rel = q1 - q2, though the minus is not correct in this context. What I tried: I seek a rotation that rotates q2 into q1 which I wrote down as: q_rel * q2 = q1 In words: The rotation q2 followed by q_rel equals q1. I then solved this for q_rel what yields: q_rel = q1 * q2.Conjugated(); I can use the conjugate since, since q1 and q2 are both unit quaternion and therefore q.Inverse() == q.Conjugated(). Is this correct? My major concern is the direction. I need the relative rotation with respect to q2 as in the vector example. Best regards, -Dirk

Share this post


Link to post
Share on other sites
Advertisement
That looks right to me. Then again, it's early and I may not be thinking clearly.

Does it work? Or are you having a problem with it?

Share this post


Link to post
Share on other sites
Quote:

I noticed you use Inverse = conjugated

For what I know the inverse is the conjugate divided by the length


Since I use unit quaternions the length is one and therefore the inverse equals the conjugate

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!