Dual-Quaternion Skinning
Twist a character's wrist a full 180^\circ with ordinary
linear blend skinning
and something horrible happens: the flesh near the joint pinches shut, as if the forearm had
been wrung out like a wet towel. Animators call it the candy-wrapper collapse — the
skin twisting down to a thin, folded neck of geometry. It is the single most notorious artefact in
real-time character skinning, and it comes from one small mistake: averaging matrices when we
should have been averaging motions.
Dual-quaternion skinning (DQS) fixes it. Instead of linearly blending each bone's
transformation matrix, it blends a compact algebraic object — a dual quaternion — that
cannot represent anything except a rigid motion. Blend rigid motions and you get a rigid
motion; there is nowhere for the collapse to hide. This page builds the dual quaternion from a plain
quaternion,
shows exactly why LBS shrinks and DQS does not, and is honest about what DQS costs you in return.
Why linear blend skinning collapses
In linear blend skinning each vertex is influenced by a few bones with weights
w_i that sum to one. The bone transforms are matrices
M_i, and the skinned vertex is a straight weighted average of the matrices,
applied to the rest position \mathbf{v}:
\mathbf{v}' = \left(\sum_i w_i\, M_i\right)\mathbf{v}.
The trouble is that the set of rotation matrices is not convex. The average of two
rotation matrices is almost never a rotation — it is a matrix that also scales. Take a bone
at 0^\circ (the identity) and a bone rotated 180^\circ
about the forearm axis (which negates two coordinates). Blend them fifty-fifty and the two
rotated axes cancel to zero: the averaged matrix squashes everything on the cross-section
to a point. That vanishing cross-section is the candy wrapper.
- LBS averages the bone matrices, and a convex average of rotations is a matrix
with scale less than one, not a rotation.
- For a half-turn twist the two opposing rotations cancel, so the mid-joint cross-section shrinks
toward zero area — the skin collapses.
- The deeper the twist, the worse the shrink; small bends look fine, which is why LBS survives at
all.
Dual quaternions: rigid motion in eight numbers
You already know that a unit quaternion q encodes a
rotation, and that the unit quaternions are a double cover of the rotation group —
q and -q name the same rotation. A
dual quaternion upgrades this to encode a rotation and a translation
together — a full rigid motion. It is built from a "dual" number whose infinitesimal unit
\varepsilon obeys the one strange rule
\varepsilon^2 = 0, \qquad \varepsilon \neq 0.
A dual quaternion is then a pair of ordinary quaternions, a real part
q_r and a dual part q_d, glued with
\varepsilon:
\hat{q} = q_r + \varepsilon\, q_d.
- The real part q_r is the rotation (a unit
quaternion).
- The dual part encodes the translation \mathbf{t} via
q_d = \tfrac{1}{2}\,\mathbf{t}\,q_r (treating
\mathbf{t} as a pure quaternion).
- A dual quaternion is unit when \|q_r\| = 1 and
q_r \cdot q_d = 0; the unit dual quaternions are exactly a double cover
of the rigid-motion group SE(3).
That last line is the whole trick. A unit dual quaternion is guaranteed to
be a rigid motion — no scale, no shear, no collapse. So if we can do our blending in the space of dual
quaternions and land back on a unit one, the result is automatically rigid.
The DQS recipe
Kavan, Collins, Žára and O'Sullivan (2007) replaced the matrix average with a
dual-quaternion average. Convert each bone transform to a unit dual quaternion
\hat{q}_i, take the same weighted sum you would have used for LBS, then
normalise:
\hat{q} = \frac{\sum_i w_i\, \hat{q}_i}{\left\|\sum_i w_i\, \hat{q}_i\right\|},
and convert \hat{q} back to a transform to skin the vertex. The weighted
sum on its own is not unit — but the sum of unit dual quaternions is never zero in the way a
matrix average is, so dividing by its norm always lands you on a genuine rigid motion sitting
"between" the bones. The collapse simply has nowhere to occur.
- Blend the bones' unit dual quaternions with the LBS weights, then normalise.
- A normalised blend of unit dual quaternions is itself a unit dual quaternion,
hence a rigid motion — so twists rotate the cross-section instead of shrinking it.
- It is a fast, closed-form approximation to the true shortest-path (ScLERP) blend, and cheap
enough to run per-vertex on the GPU.
Because every blended transform is rigid, DQS is often described as volume-preserving
near joints: the twisting cross-section keeps its area and just rotates, which is exactly what real
flesh does.
Watching the twist collapse — and not
Below, both panels show the cross-section of a forearm as the wrist twists from
0^\circ toward 180^\circ. Drag the twist angle.
The left square is skinned with LBS: its blended matrix carries a scale factor of
\cos(\theta/2), so the square deflates to a thin sliver as
\theta \to 180^\circ — the candy wrapper. The right square
is skinned with DQS: the same twist just rotates the cross-section rigidly, and it keeps its
full size all the way round.
Watch the corners. Under LBS they slide inward toward the axis; at
180^\circ all four have nearly met on the centre line — zero area. Under
DQS they sweep around a circle of fixed radius: same area, just turned. That gap between "shrinks to a
point" and "turns in place" is the entire reason DQS exists.
Worked example: the 180° wrist twist
Model the joint as a blend of two bones with equal weight
w_1 = w_2 = \tfrac12: bone 1 is unrotated, bone 2 is rotated by
\theta about the forearm (the z) axis. Take a
rest point on the cross-section at radius one, \mathbf{v} = (1,0).
LBS. The blended 2\times2 rotation block is
\tfrac12 I + \tfrac12 R(\theta) = \begin{pmatrix} \tfrac{1+\cos\theta}{2} & -\tfrac{\sin\theta}{2} \\[4pt] \tfrac{\sin\theta}{2} & \tfrac{1+\cos\theta}{2} \end{pmatrix}.
Its singular values are \cos(\theta/2) (not one!), so the cross-section is
scaled by \cos(\theta/2). At \theta = 180^\circ
that factor is \cos 90^\circ = 0: the point maps to the origin. Total
collapse. At 90^\circ it is already down to
\cos 45^\circ \approx 0.707 — a visible 30\%
pinch.
DQS. Convert each bone to a unit quaternion:
q_1 = 1 and
q_2 = \cos(\theta/2) + \sin(\theta/2)\,k. Blend and normalise. The
normalised half-sum is again a unit quaternion representing rotation by exactly
\theta/2 — a pure rotation, scale one. At
180^\circ the cross-section is simply turned by
90^\circ: (1,0) \mapsto (0,1), radius still one.
No collapse.
Same weights, same bones, same twist — LBS multiplies your radius by
\cos(\theta/2) while DQS keeps it at one. That single factor is the whole
story.
Dual quaternions inherit the quaternion's double cover: \hat{q}
and -\hat{q} are the same rigid motion. But the blend
\sum w_i \hat{q}_i is not sign-invariant — if two bones
arrive with opposite signs, their real parts partly cancel and you blend "the long way
round", getting a wild flip or a near-zero, unstable result. It is exactly the slerp shortest-path
problem. The fix: before summing, pick a reference bone and flip the sign of
any \hat{q}_i whose real part has a negative dot product with it
(q_{r,i} \cdot q_{r,0} < 0 \Rightarrow \hat{q}_i \leftarrow -\hat{q}_i).
Align the hemispheres first, then blend.
And DQS is not free of artefacts. Because it favours the shortest rigid arc, a bent joint (an elbow,
a knee) tends to bulge outward — the "joint inflation" or "candy-wrapper's cousin".
DQS trades LBS's collapse for a milder, opposite fault: where LBS deflates a twist, DQS puffs up a
bend. Neither is physically perfect; each just fails in a different, more or less forgivable direction.
Not quite. DQS costs a little more per vertex (the convert-blend-normalise-reconvert dance) and it
only handles rigid per-bone transforms — no non-uniform scale or shear through the blend. So
many production rigs keep plain LBS for speed and cancel the candy wrapper a different way: with
corrective shapes and helper/twist bones driven by the joint angle,
or with dual-quaternion blending only on the arms and wrists where twist is worst. Games and real-time
avatars lean toward DQS (one shader, no sculpting); film rigs, which can afford hand-authored
correctives and want full control, often stay on LBS-plus-correctives. It is a classic
"cheap-and-automatic vs. costly-and-controllable" engineering choice.