Rotation
Rotation is represented by the unit quaternion
Spherical linear interpolation
Spherical linear interpolation (slerp) is used between two unit quaternions:
It moves along the short arc on the unit-quaternion sphere. If
Chasing the target
The chase algorithm uses the previous frame's output
where:
and
If the target stays unchanged, the recurrence is equivalent to:
When the target is unchanged, the recurrence reduces to a single spherical interpolation from
Feed-forward with error correction
The feed-forward-with-error-correction algorithm first applies the target's inter-frame rotation, then corrects the difference between the camera and the current target. Let:
where
Then correct toward the current target using
When the target is stationary,