Using quaternions for smooth rotations
Spherical Linear Interpolation, or SLERP for short, uses mathematics to rotate from the position of one quaternion to the position of another quaternion. Figure 7.10 shows an example of SLERP. The red line is the path for the interpolation between the quaternions with orientations and .
Figure 7.10: Spherical Linear Interpolation between two quaternions
Doing the same transition with Euler angles works in one dimension. But for a full three-dimensional path between two quaternions, there is no simple mathematical solution to go from one combined rotation to another while maintaining a steady path in all the directions of the movement.
Note
Rotating from orientation and has a second solution: the other way around the circle, starting on and going “downward.” It is not guaranteed that Spherical Linear Interpolation will use the shortest path between two quaternions; this must be checked in the implementation...