Jump to content
  • Advertisement
Sign in to follow this  
floatingwoods

quaternion and -quaternion: what is different?

This topic is 3662 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 using quaternions to store orientations and never had any problems. Now I am also interpolating between quaternions and in some rare cases, the interpolation looks wrong (going the longer way). When this happens, I rotate one of the the quaternion around one of its axes by 360 degrees and then the interpolation is ok! The euler angles between the quaternion and the 360-degree rotated quaternion are same, but the rotated quaternion appears to have been multiplied by -1. My question is: what is the difference between q=(w,x,y,z) and -q=(-w,-x,-y,-z)? To me it appears that q and -q don't make a difference when representing an orientation, but for interpolation, it makes a difference. To fix the interpolation problem, I first do a scalar product between the two quaternions and if the result is negative, I multiply one by -1, and then my interpolations are always ok

Share this post


Link to post
Share on other sites
Advertisement
Yes - q represents the same rotation as -q

and

Yes - you need to negate one quaternion when slerping if the dot product is negative.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!