Quaternion Interpolation

There are two problems that I see with lerping quaternions:

  1. You can get interpolated values of (0, 0, 0, 0), that is, entirely invalid values that can not be salvaged by normalizing. Since quaternions allow two different representations of the same orientation, you can have a seemingly static object do a sudden jump at just a single frame. Example: Suzanne in an otherwise empty scene. Set a w=1, xyz=0 key at frame 1, a w=-1, xyz=0 key frame at frame 13. Now play back the animation - Suzanne will be static except for a sudden flip at frame 7. You could try and hide this manually by inserting extra key frames, but this will only work if you’re not using motion blur, where sub-frames are evaluated too.

  2. It is not using the shortest path on a sphere. While this is a desirable property for Euler angles and allows one to do rotations of more than 360 degrees between keyframes, the restriction of no more than two turns makes it less useful for quaternions. Again, this is something that can hide in subframes - we’ve had, in production, animation that looked perfect in an OpenGL playblast, but when rendered with motion blur showed erratic steaks at seemingly random frames that turned out to be rotations interpolated “the long path” between two key frames.

This is why I think the current interpolation is something that works most of the time for most people, but has corner cases in which it fails very visibly. The only workaround I could come up with would be to forcibly break the interpolation by inserting constant key frames, but that requires tracking down every single instance where those unwanted interpolations happen. I don’t think that this is a practical solution. Neither for they hobbyist who may not have the necessary mathematical understanding of quaternions, nor to the big studio that would have to find needles in a haystack when it comes to complex rigs with hundreds of key frames.

I’m not denying that lerp and direct access is useful to you - I’m all for allowing technical users to go wild - but at the moment I think quaternions are not predictable or fail safe enough to be useful to everyone.

2 Likes