Handmade Network»Forums
Abhaya Uprety
8 posts
Q: Axis angle interpolation lerp vs slerp
Edited by Abhaya Uprety on Reason: Initial post
Linearly interpolating between 2 orientations represented by axis angle results in non-constant angular velocity. Spherical interpolation however doesn't suffer from this problem.

Why is that? Hopefully someone could point me to mathematical derivation. Thus far I am able to derive axis angle to matrix representation and back, but haven't found explanation for this.

Lerp vs slerp demo can be seen here. Demo has been made from this article
183 posts / 1 project
Q: Axis angle interpolation lerp vs slerp
Edited by Dawoodoz on
The reason is that an axis is an X, Y, Z Cartesian vector, while a quaternion can be seen more as a rotation description. If you draw a straight line from one point to another within a circle, the middle of that line is closer to the circle's center. Taking the average of two opposing vectors becomes zero for example. ((1, 2, 3) + (-1, -2, -3)) / 2 = (0, 0, 0)

Normalizing the resulting direction vector by dividing by its own length can be done in pixel shaders after vertex or texel interpolation to make things look better, but that will make the transition go faster when the interpolated line comes close the center, so it's just a visual hack.

Another vector based approach is to approximate a polygon arc by splitting the line into two equal lengths with a normalized midpoint and continue bisecting on the line that's closer to the input ratio, until you are close enough to just interpolate with the remainder and normalize. This can be useful for visualizing a plane flying around a globe with constant speed but won't be useful for handling rotation.