# Chapter 51: Character Animation

## Dual Quaternions

Dual numbers form a number system similar to complex numbers. Whereas complex numbers involve a real and imaginary part, dual numbers involve a real and a dual part. Just like the imaginary part of a complex number is multiplied by , the dual part of a dual number is multiplied by a new operator such that

Where is the dual number, is the real part, and is the dual part.

A dual number is a number formed with two quaternions - a real quaternion and a dual quaternion, such that:

Where is the dual quaterion, is a quaternion representing the real part and is a quaternion representing the dual part.

It turns out that a dual quaternion can be used to represent a composite rotation and translation. The real part of the dual quaternion represents the rotation in standard quaternion form. The imaginary part represents the translation multipled by the rotation:

Where is a quaternion formed by:

Which is the standard way of representing a translation as a quaternion.

So what does this get us?
Well, we ordinary use 4x4 matrices to represent arbitrary transformations in 3D space.
However, there are a lot of times where we want rotational and translation components but we don’t have any scale.
A composite rotation and translation is sometimes called a **rigid transform**.

If we’re implementing rigid body physics, we might only need rotation and translation for each object in the simulation. In character hierarchies, we very commonly have only rotation and translation for each joint configuration. Using dual quaternions in these situations gives us a compact representation (8 floats) for something we might ordinarly need 16 floats for.

In addition, there are some techniques based on dual quaternions. For example, dual quaternion skinning is an alternative to standard linear blend skinning that avoids certain artifacts.

## References

### Skinned Animation

- OpenGL Wiki - Skeletal Animation
- (My) ionEngine - Skinned Animation Sample
- Skinning with Dual Quaternions
- A Beginners Guide to Dual-Quaternions
- Elastic-Inspired Deformers for Character Articulation

### Inverse Kinematics

- Overview and Terminology of IK
- (My) ionEngine - Inverse Kinematics Sample
- FABRIK - Fast and Effective IK Technique