Flipping issue when interpolating Rotations using Quaternions

Posted by uhuu on Stack Overflow See other posts from Stack Overflow or by uhuu
Published on 2010-05-22T01:45:47Z Indexed on 2010/05/22 1:50 UTC
Read the original article Hit count: 265

Filed under:
|
|
|
|

I use slerp to interpolate between two quaternions representing rotations. The resulting rotation is then extracted as Euler angles to be fed into a graphics lib. This kind of works, but I have the following problem; when rotating around two (one works just fine) axes in the direction of the green arrow as shown in the left frame

here

the rotation soon jumps around to rotate from the opposite site to the opposite visual direction, as indicated by the red arrow in the right frame.

This may be logical from a mathematical perspective (although not to me), but it is undesired. How could I achieve an interpolation with no visual flipping and changing of directions when rotating around more than one axis, following the green arrow at all times until the interpolation is complete?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about math

Related posts about 3d