Quaternion Expression
Quaternion Tag
General
The dreaded problem of gimbal lock becomes a thing of the past when you use this powerful tag.
Surely you have already heard of the dreaded ‘gimbal lock’ in connection with character animation. Or worse, you already have experience of it.
Now Quaternion has stepped up to the plate!
CINEMA 4D uses Euler angles by default to interpolate the rotation of bones. The individual components of the Eular angles are interpolated independently of one another. For example, the value midway between HPB (0,0,0) and HPB (60,60,60) would be HPB (30,30,30).
The path from (0,0,0) over (30,30,30) to (60,60,60) is not exactly the shortest. You can test this in the viewport yourself. What we want is the shortest possible interpolation, which any user would attempt to do manually.
This is where quaternions come in; quaternion interpolation achieves a much shorter, smoother interpolation between the keyframes and manages to avoid the problem of gimbal lock. The quaternion path in the example will lead from 0,0,0 to 60,60,60 via 35.104, 22.83, 25.104.
You are probably wondering why a Quaternion tag isn’t simply applied to all bones! Easy – every advantage also has a disadvantage, and here the Quaternion tag is no exception. As long as a rotation is not altered by more than 180 degrees, Quaternion can work its magic. But anything beyond 180 degrees will cause problems because, as already mentioned, Quaternion will strive to find the shortest path.
Example
Let’s take an example: Suppose you want to rotate an object around an axis by more than 180 degrees.
![]() ![]() |
| The rotation of the object at the start of the animation |
To do this you’d record a key at frame 0 with the object in its starting rotation,;move the time slider to the frame; rotate the object as desired and record another key. The rotation of the object at the start and end of the animation is shown in the images above.
![]() ![]() |
| The rotation of the object at the end of the animation |
So far so good. Now let’s take a look at what happens to the path taken by the rotation animation if it is interpolated in the traditional way, i.e. using Euler angles. Suppose you have keyframed the object to rotate around P by –185°. The object will rotate, from the point of view of the camera, through 185 degrees clockwise (see left image below).
Now let’s look at the way Quaternion behaves. As you know, this method of interpolation searches for the shortest possible path. The shortest path, though, is not (from the point of view of the observer) clockwise 185 degrees but counterclockwise 175 degrees. See the right image above.