Skinning with Dual Quaternions
Ladislav Kavan∗ 1,2 Steven Collins1 Jiřı́ Žára2 Carol O’Sullivan1
1 Trinity College Dublin, 2 Czech Technical University in Prague
84.9 FPS 197.4 FPS 55.1 FPS 122 FPS
Log-matrix Blending Dual Quaternions Spherical Blend Skinning Dual Quaternions
Figure 1: A comparison of dual quaternion skinning with previous methods: log-matrix blending [Cordier and Magnenat-Thalmann 2005] and
spherical blend skinning [Kavan and Zara 2005]. The proposed approach not only eliminates artifacts, but is also much easier to implement
and more than twice as fast.
Abstract deformation or enveloping. It is sometimes used not only for skin
deformation (as the name suggests) but also to animate cloth, be-
Skinning of skeletally deformable models is extensively used for
cause it is considerably faster than physically based cloth simula-
real-time animation of characters, creatures and similar objects.
tion [Cordier and Magnenat-Thalmann 2005]. The basic princi-
The standard solution, linear blend skinning, has some serious
ple is that skinning transformations are represented by matrices and
drawbacks that require artist intervention. Therefore, a number of
blended linearly. It is very well known that the direct linear com-
alternatives have been proposed in recent years. All of them suc-
bination of matrices is a troublesome way of blending transforma-
cessfully combat some of the artifacts, but none challenge the sim-
tions. This produces artifacts in the deformed skin, even if we re-
plicity and efficiency of linear blend skinning. As a result, linear
strict the skinning transformations to rigid ones (i.e., composition
blend skinning is still the number one choice for the majority of
of a rotation and translation). In spite of these shortcomings, linear
developers. In this paper, we present a novel GPU-friendly skin-
blending is still a very popular skinning method, but perhaps only
ning algorithm based on dual quaternions. We show that this ap-
because there is no simple alternative.
proach solves the artifacts of linear blend skinning at minimal ad-
ditional cost. Upgrading an existing animation system (e.g., in a Recent previous work suggests converting rigid transformation ma-
videogame) from linear to dual quaternion skinning is very easy trices to (quaternion,translation) pairs and blending them instead
and has negligible impact on run-time performance. of matrices [Hejl 2004; Kavan and Zara 2005]. This works, but at
CR Categories: I.3.5 [Computer Graphics]: Computational a cost: Hejl’s algorithm [2004] imposes constraints on the model’s
Geometry and Object Modeling – Geometric Transformations— rigging (specifically, a vertex can only be influenced by neighbour-
[I.3.7]: Computer Graphics—Three-Dimensional Graphics and Re- ing bones, otherwise artifacts can occur). This could be inconve-
alism – Animation nient, because linear blending has no such constraints (and it is ex-
ploited for many 3D models). Kavan and Zara’s method [2005]
Keywords: skinning, rigid transformations, blending, dual quater- does not have this restriction, but uses a complex and computation-
nions, linear combinations ally expensive Singular Value Decomposition scheme. Obviously,
the elegancy of linear blend skinning is lost in both cases.
1 Introduction The representation of rigid transformations by matrices or
(quaternion,translation) pairs illustrates just two possible param-
Skinning and skeletal animation is the technology behind charac- eterizations of the group of rigid transformations. Nothing prevents
ter animation in many applications. In some situations, physically us from blending, for example, 3-tuples (axis, angle,translation)
accurate skin deformation, which supports muscle bulging and dy- or pairs (axis + translation, sin(angle)). Even if we restrict our-
namic effects, is desirable. In other situations, however, a fast algo- selves to blending via linear combinations, we can construct in-
rithm capable of skinning multiple models interactively is needed – finitely many different blending methods just by considering differ-
especially in the context of videogames. ent parameterizations of rigid transformations.
The standard algorithm for low-cost skinning is known by many
names: linear blend skinning, vertex blending, skeletal subspace A natural question arises: which parameterization of rigid transfor-
mations is the best one for skinning? First of all, it is necessary
∗ e-mail: kavanl@[Link] to clarify what “best” means in this context. We summarize the
mathematical properties that an ideal blending method for skinning
should possess in Section 3.1. Next, we show that these properties
are satisfied by a representation of rigid transformations known as
dual quaternions – a generalization of regular quaternions invented
in the nineteenth century [Clifford 1882].
From a practical point of view, dual quaternions offer a very sim-
ple yet efficient skinning method. Due to the properties of dual
quaternion blending, none of the skin collapsing effects exhibited [Hyun et al. 2005] or auxiliary curved skeletons [Yang et al. 2006;
by linear blend skinning will manifest themselves. Blending of Forstmann and Ohya 2006]. In some cases, this also allows ad-
dual quaternions can be elegantly computed in a vertex shader with vanced effects to be animated, such as muscle bulging. The disad-
complexity comparable to standard linear blending. Dual quater- vantages include complexity of the GPU implementation (even the
nions are more memory efficient, requiring only 8 floats per trans- very efficient Forstmann’s method [2006] is about 3 times slower
formation (essentially, two regular quaternions), instead of the 12 than linear blend skinning) and inconsistency with the established
required by matrices. In an existing application, it is extremely easy rigging standard: new rigging tools and data formats are needed.
to replace a linear blend skinning implementation by a dual quater- In this paper, we argue that the problems of linear blending do not
nion one. All that is necessary is a slight modification of the vertex stem from incorrect rigging, but from incorrect blending. With dual
shader and conversion of the matrices to dual quaternions before quaternion skinning, it is therefore neither necessary to change the
passing them to the shader. The model files as well as the internal rigging structures nor to update existing models.
data structures do not need any change at all – the only difference
is in the transformation blending. Dual quaternions. The first reference to dual quaternions (his-
torically called bi-quaternions) appears in [Clifford 1882], along
with the more general concept of geometric algebras. These alge-
2 Related Work bras naturally contain not only vectors and quaternions, but also
k-dimensional subspaces [Wareham et al. 2005]. This leads to very
Historically, the idea of skin deformation by an underlying skeleton elegant and dimension-independent expressions of geometric prop-
is credited to [Magnenat-Thalmann et al. 1988]. Since then, sev- erties, but sometimes unfortunately also to an increase in time and
eral different approaches to skeletal animation have emerged. Our memory complexity of the resulting implementation [Fontijne and
approach – dual quaternion skinning – falls into the category of ge- Dorst 2003]. Dual quaternions, in turn, are not so general, but
ometric methods. are more compact and faster to manipulate. For computer graph-
ics practitioners, the big advantage of dual quaternions is that they
Physically based methods. A logical approach to character anima-
are based on regular quaternions – a well-known tool in computer
tion is to simulate the internal structure of the body: bones, muscles
graphics [Shoemake 1985].
and fat tissues. This can work either with explicit anatomy knowl-
edge [Scheepers et al. 1997; Aubel and Thalmann 2000; Teran Blending vs interpolation. A vast amount of literature has been
et al. 2005], or without [Capell et al. 2002; Guo and Wong 2005; devoted to the problem of transformation interpolation [Barr et al.
Pratscher et al. 2005]. Physically based methods generally obtain 1992; Juttler 1994; Marthinsen 1999; Belta and Kumar 2002; Hofer
a high level of realism (delivering also dynamic effects and muscle and Pottmann 2004; Li and Hao 2006]. This is not surprising, be-
bulges), but at high computational costs. cause the construction of interpolation curves for given key trans-
formations (e.g., camera orientations) is a fundamental problem in
Capturing real subjects. Several methods successfully exploit
computer animation. Unfortunately, in skinning, we face a different
modern motion capture and/or 3D scanning devices to capture skin
problem: the blending of rigid transformations, i.e., their weighted
deformation of real people [Allen et al. 2002; Anguelov et al. 2005;
average (confusingly, in some literature this is also called interpola-
Park and Hodgins 2006; Allen et al. 2006]. These approaches are
tion). The weighted averages can be used to construct interpolation
highly accurate, but require expensive hardware and are of course
curves (see [Buss and Fillmore 2001]) but not vice versa.
limited only to existing subjects.
Example based techniques. Multiple input meshes can be used 3 Dual Quaternion Skinning
both to resolve the artifacts of linear blending and to add additional
effects like muscle bulging. Example based methods use either In this section, we first quickly review previous geometric skin-
direct interpolation between example meshes [Lewis et al. 2000; ning algorithms (Section 3.1), identifying their strengths and weak-
Sloan et al. 2001], correction by principal components of example nesses and deriving properties that an ideal blending for skinning
deformations [Kry et al. 2002] or fit the linear blending parameters should possess. Then we present a short tutorial on dual quaternions
to match the provided examples [Wang and Phillips 2002; Mohr and (Section 3.2) and discuss dual quaternion blending (Section 3.3).
Gleicher 2003]. Recently, a more accurate (yet more complex) ex- The final dual quaternion skinning algorithm is summarized in Sec-
ample interpolation method has been proposed [Kurihara and Miy- tion 3.4.
ata 2004] and augmented with an innovative GPU approach [Rhee
et al. 2006]. Generally, this class of methods offers a level of re- Conventions. We denote scalars by lower-case letters, vectors and
alism limited only by the number of input examples. However, the quaternions in bold and matrices by capital letters. Dual quantities
production of examples can be costly, requiring a lot of memory to are distinguished from non-dual by a caret, e.g., â denotes a dual
store them and the animator’s labour. number and q̂ a dual quaternion. The i-th component of vector v is
written as vi , thus also v = (v1 , . . . , vn ). The dot product of vectors v
Geometric methods. In this case, only one input mesh is given and w is denoted as v, w and v is the usual vector norm. Cross
(designed in a reference pose). The skeleton-to-skin binding is de- product is denoted as v × w.
fined in a direct, geometrical way. The most popular way, estab-
lished with linear blend skinning, is to bind each vertex to one or
more joints. In the latter case, the weight (amount of influence) of 3.1 Background on Geometric Skinning
each influencing joint must be specified. Advanced blending meth-
ods, e.g., direct quaternion blending [Hejl 2004], log-matrix blend- In the following section, we focus only on geometric skinning
ing [Cordier and Magnenat-Thalmann 2005] and spherical blending methods with linear blend skinning-style rigging structure (which
[Kavan and Zara 2005] also use this rigging structure. Even though is a de facto standard in the videogames industry). A 3D object
these techniques remove some artifacts, they still fall short of de- conforming to this standard consists of skin, a skeleton and vertex
livering natural skin deformation in all postures (see Figure 1 and weights. The skin is a 3D triangular mesh with no assumed topol-
Section 3.1). ogy or connectivity and the skeleton is a rooted tree (both designed
in a reference pose). The nodes of the skeleton represent joints and
Some researchers propose combatting skinning artifacts by imple- the edges can be interpreted as bones. However, each node (except
menting a different rigging method, e.g., based on sweep surfaces the root node) can be easily identified with the edge leading to it, so
the difference between joints and bones is rather moot in our case.
The transformations relating joints in the hierarchy are assumed to
be rigid (we do not consider scale or shear). The vertex weights
describe the skin-to-skeleton binding, i.e, the amount of influence
of individual joints on each vertex.
Let us assume that there are p joints in our model. We usually
store the joints in an array, with every joint referenced by a number
1, . . . , p. In the reference (rest) pose, each joint has an associated
local coordinate system. The transformation from the rest-pose of Figure 3: Artifacts of log-matrix blending [Alexa 2002] caused by
joint j to its actual position in the animated posture can be expressed choosing a longer trajectory than necessary.
by a rigid transformation matrix – let us denote this matrix as C j .
We assume that vertex v is attached to joints j1 , . . . , jn with weights has none of the above-mentioned problems: it always produces
w = (w1 , . . . , wn ). The indices j1 , . . . , jn are integers referring to rigid transformations and selects the shortest path of the interpo-
the joints that influence a given vertex – in other words, they are in- lated rotation [Kavan and Zara 2005]. Unfortunately, the blending
dices into the array of joints. There is usually a fixed upper bound of quaternions and translation vectors independently has another
on n (the number of influencing joints), typically 4, following from pitfall – dependence on the body-space coordinate system. In
graphics hardware considerations. The weights are normally as- practice, this means that the model’s vertices rotate around the
sumed to be convex, i.e., wi ≥ 0 and ∑ni=1 wi = 1 (however, this origin of the body-space. The origin is user-defined and usually
non-negativity is not exploited in our algorithm). The i-th compo- coincides with the center of mass. In many applications, rotation
nent of vector w, wi , represents the amount of influence of joint ji around the center of mass is exactly what we need. However, this
on vertex v. is not the case for skinning.
The vertex position in the mesh deformed by linear blend skinning Rotation of model vertices around the center of mass produces un-
is then computed as: acceptable skin deformations. Intuitively, vertices influenced by
both the lower and upper arm should naturally rotate about a point
n n near the elbow. This is the principle of [Hejl 2004]: the vertices
v = ∑ wiC j v = ∑ wiC j
i i
v (1) rotate around the nearest joint. In cases similar to that of the elbow
i=1 i=1 (two bones connected by a joint), this works perfectly. However,
for more complex joint influences, such as those usually occurring
that is, taking a linear combination of joint transformation matri- around the armpit or dorsum, artifacts result from the fact that the
ces. This explains the skin collapsing artifacts (see Figure 2) – the center of rotation is fixed and does not adapt to the actual posture. In
blended matrix ∑ni=1 wiC ji is no longer a rigid transformation, but a character models, these artifacts can be usually avoided by careful
general affine one (potentially containing scale and shear factors). rigging. However, they are inevitable in other deformable objects,
Formally speaking, the skin collapsing effects visualize the fact that such as our simple cloth model shown in Figure 4.
the set of orthonormal matrices is not closed under addition.
Figure 4: Artifacts of direct quaternion blending [Hejl 2004] caused
by fixed rotation centers.
Figure 2: Typical “candy-wrapper” artifacts of linear blend skin-
ning. The limitations of Hejl’s method can be resolved as described in
[Kavan and Zara 2005], which presents an accurate method to com-
A blending method that avoids such skin-collapsing defects must pute the rotation centers. It works by minimizing the translation
therefore deliver a rigid transformation in all cases. The blending of of the resulting blended transformation (c.f. with Hejl’s method
matrix logarithms [Alexa 2002] satisfies this condition and has been which works correctly only when this translation is zero). Unfor-
implemented for skinning by [Cordier and Magnenat-Thalmann tunately, the cost of this approach is significant: it requires a least-
2005]. Unfortunately, log-matrix blending has a different problem: squares solution of a set of equations, carried out using Singular
in some cases, it picks a longer trajectory than necessary when in- Value Decomposition (SVD). Since it is not affordable to run SVD
terpolating rotation [Bloom et al. 2004]. This means that instead per vertex, the rotation centers are cached and reused for clusters
of a direct, straight rotation, a diversion is sometimes taken, which of vertices. This trick enables real-time performance of spherical
can result in unsightly artifacts (see Figure 3). Our desired blending blend skinning to be achieved. Unfortunately, the recycling of rota-
should therefore always interpolate rigid transformations along the tion centers may cause discontinuities of the deformed skin in areas
shortest path, i.e., along a geodesic in the manifold of rigid transfor- where the clusters concur (see Figure 5). These artifacts are how-
mations [Hofer and Pottmann 2004]. Note that this can be achieved ever much less frequent (and apparent) than with direct quaternion
for log-matrix blending in the case of two transformations [Li and blending.
Hao 2006], but this method does not generalize to n transforma-
tions. Note that it was not necessary (and not even possible) to choose
a rotation center in linear or log-matrix blending. This is be-
Decomposing rigid transformation matrices into cause both of these approaches are coordinate invariant, i.e., it
(quaternion,translation) pairs and blending them linearly does not matter if we switch our transformations to a new coor-
We assume that the reader is already familiar with regular quater-
nions, otherwise see for example [Dam et al. 1998; Hanson 2006].
Dual quaternions can be considered as quaternions whose elements
are dual numbers. The algebra of dual numbers is similar to com-
plex numbers: any dual number â can be written as â = a0 + ε aε ,
where a0 is the non-dual part, aε the dual part and ε is a dual unit
satisfying ε 2 = 0. The dual conjugate is analogous to the complex
conjugate: â = a0 − ε aε . Multiplication of two dual numbers is
given as (a0 + ε aε )(b0 + ε bε ) = a0 b0 + ε (a0 bε + aε b0 ). The in-
Figure 5: Discontinuities of spherical blend skinning [Kavan and
Zara 2005] caused by caching rotation centers. verse of a dual number â−1 is given by
1 1 aε
= −ε 2 (2)
dinate system before or after the blending. This is easy to ver- a0 + ε aε a0 a0
ify: if matrix M represents a change of coordinates, then matrices as can be immediately verified. The previous expression is defined
C j1 , . . . ,C jn expressed with respect to the new coordinate system only when a0 = 0. Purely dual numbers, that is dual numbers with
become MC j1 M −1 , . . . , MC jn M −1 . Linear blending with these ma- a0 = 0, do not have an inverse. This is a fundamental difference
trices gives: from complex numbers, because every non-zero complex number
has an inverse. The square root is defined only for dual numbers
n n
with a positive non-dual part, and it is computed as
∑ wi MC j M−1
i
=M ∑ wiC j i
M −1
√
i=1 i=1 √ aε
a0 + ε aε = a0 + ε √
2 a0
which follows from the distributive property of matrix multiplica-
tion. We see that the resulting blended matrix is really the same
as that for matrices C j1 , . . . ,C jn , just with respect to the new co- A dual quaternion q̂ can be written as q̂ = ŵ + ix̂ + jŷ + kẑ, where ŵ
ordinate system (of course). The same reasoning can be repeated is the scalar part (dual number), (x̂, ŷ, ẑ) is the vector part (dual vec-
for log-matrix blending if we recall the following properties of ma- tor), and i, j, k are the usual quaternion units. The dual unit ε com-
trix exponential and logarithm: exp(MC ji M −1 ) = M exp(C ji )M −1 mutes with quaternion units, for example iε = ε i. A dual quater-
and log(MC ji M −1 ) = M log(C ji )M −1 (see [Moakher 2002]). This nion can also be considered as an 8-tuple of real numbers, or as the
shows that log-matrix blending is coordinate-invariant. sum of two ordinary quaternions, q̂ = q0 + ε qε . Conjugation of a
dual quaternion is defined using classical quaternion conjugation:
Why does this not work for (quaternion,translation) pairs? The q̂∗ = q∗0 + ε q∗ε . The norm of a dual quaternion can be written as
√ √
reason is that if we define an algebra over (quaternion,translation) q̂ = q̂∗ q̂ = q̂q̂∗ , which expands to
pairs, with multiplication corresponding to composition of trans-
formations, then this algebra is not distributive. Specifically, it is q0 , qε
q̂ = q̂∗ q̂ = q0 + ε (3)
not distributive with respect to right multiplication [Kavan and Zara q0
2005] (it is with respect to left multiplication). As right multiplica-
tion corresponds to the change of body-space coordinates (and left The norm satisfies the usual property p̂q̂ = p̂q̂. The inverse
multiplication to the change of world-space coordinates), this just of a dual quaternion is defined only when q0 = 0. In this case,
∗
reflects the fact that blending (quaternion,translation) pairs rotates we have q̂−1 = q̂q̂2 . Unit dual quaternions are those satisfying
about the origin of the body-space. q̂ = 1. According to the previous formula, a dual quaternion q̂ is
To summarize, we see that an optimal rigid transformation blending unit if and only if q0 = 1 and q0 , qε = 0. Note that unit dual
method for skinning should: quaternions are always invertible (their inverse is just conjugation).
Just like ordinary quaternions, dual quaternions are also associative,
• always return a valid rigid transformation (to prevent skin- distributive, but not commutative.
collapsing effects)
As expected, unit dual quaternions naturally represent 3D rotation,
• be coordinate-invariant (to avoid the problems with rotation when the dual part qε = 0. If we have a 3D vector (v0 , v1 , v2 ), we
center) define the associated unit dual quaternion as v̂ = 1 + ε (v0 i + v1 j +
v2 k). The rotation of vector (v0 , v1 , v2 ) by a dual quaternion q̂ can
• interpolate two rigid transformations along the shortest path
(to mimic natural skin behaviour and avoid excessive stretch- then be written as q̂v̂q̂∗ (where q̂∗ denotes both quaternion and dual
ing) conjugation). This can be verified, because if qε = 0 then q̂ = q0
and q̂v̂q̂∗ simplifies to
Note that because we work with all types of rigid transformations,
the shortest path property actually embraces two properties: short- q0 (1 + ε (v0 i + v1 j + v2 k))q∗0 = 1 + ε q0 (v0 i + v1 j + v2 k)q∗0
est path rotation and translation. Shortest path rigid transformations where q0 (v0 i + v1 j + v2 k)q∗0 is the familiar formula for rotation by
correspond to screws (see next section). Besides the above stated a regular quaternion.
properties, the blending should of course be efficiently computable,
typically on a GPU. As we will show in the remainder of this paper, What is interesting is that dual quaternions can also represent 3D
our proposed dual quaternion blending satisfies all of these require- translation. A unit dual quaternion t̂, defined as t̂ = 1 + ε2 (t0 i +
ments. t1 j + t2 k) corresponds to translation by vector (t0 ,t1 ,t2 ) (note that
dual quaternions work with half of the translation vector, analogous
3.2 Dual Quaternions to classical quaternions, which work with half of the angle of rota-
tion). If we simplify t̂v̂t̂∗ , we obtain 1 + ε ((v0 + t0 )i + (v1 + t1 ) j +
Dual quaternions are not a standard tool in computer graphics, in (v2 + t2 )k), which shows that the unit dual quaternion t̂ really per-
contrast to regular quaternions. This section provides a brief tuto- forms translation by (t0 ,t1 ,t2 ). Rigid transformation is a composi-
rial; for further details, see [McCarthy 1990; Kavan et al. 2006]. tion of rotation and translation, and composition of transformations
corresponds to multiplication of dual quaternions. If the rotation
is described by unit quaternion q0 and the translation by unit dual
quaternion 1 + ε2 (t0 i + t1 j + t2 k) as before, then their composition
is
ε ε (qe/2).s0
(1 + (t0 i + t1 j + t2 k))q0 = q0 + (t0 i + t1 j + t2 k)q0 (4)
2 2
We can verify, by direct computation, that the result is always a
unit dual quaternion and, conversely, that any unit dual quaternion q0/2
can always be written in this form. Let us assume that we already s0
have a routine for conversion between a 3 × 3 rotation matrix and a
s0 p
unit quaternion, as well as a routine for quaternion multiplication.
Equation (4) then shows how to convert a 4 × 4 rigid transformation
matrix to a unit dual quaternion. The opposite conversion, from a 0 p 0
unit dual quaternion q0 + ε qε to a matrix is also straightforward.
The rotation is just a matrix representation of q0 and the translation
is given by the vector part of 2qε q∗0 . Figure 6: Example of a screw motion, side and top view.
Every unit dual quaternion q̂ can be written as
Firstly, it is clear that DLB always returns a rigid transformation,
θ̂ θ̂ because DLB computes a unit dual quaternion which can be subse-
q̂ = cos + ŝ sin (5) quently converted to a rigid transformation matrix.
2 2
Secondly, in order to demonstrate the coordinate-invariance of
where ŝ is a unit dual vector with zero scalar part, see [McCarthy
DLB, we have to verify that for any unit dual quaternion r̂, the fol-
1990] or [Daniilidis 1999]. Note that this looks like the formula
lowing formula is true:
for regular quaternions, just employing the dual angle θ̂ = θ0 + εθε
and unit dual vector ŝ = s0 + ε sε . The geometric interpretation of DLB(w; r̂q̂1 r̂∗ , . . . , r̂q̂n r̂∗ ) = r̂DLB(w; q̂1 , . . . , q̂n )r̂∗ (6)
those quantities is related to screw motion, that is a rotation and
translation about the same axis. Chasle’s theorem [Daniilidis 1999] In fact, this breaks down to verifying two similar properties, called
states that any rigid transformation can be described by a screw left and right invariance. Left invariance requires that
motion (see Figure 6). Angle θ0 /2 is the angle of rotation, and unit
vector s0 represents the direction of the axis of rotation. θε /2 is the DLB(w; r̂q̂1 , . . . , r̂q̂n ) = r̂DLB(w; q̂1 , . . . , q̂n )
amount of translation along vector s0 , and sε is the moment of the and right invariance, by analogy, requires that:
axis. Moment is an unambiguous description of the position of an
axis in space. It is given by equation sε = p×s0 , where p is a vector DLB(w; q̂1 r̂, . . . , q̂n r̂) = DLB(w; q̂1 , . . . , q̂n )r̂
pointing from the origin to an arbitrary point on the axis. Which
point we choose is not important, because for any other point of the It should be clear that left and right invariance together imply
axis, say p + cs0 (where c is an arbitrary scalar), we obtain the same coordinate-invariance. To prove left invariance, it is sufficient to
moment: (p + cs0 ) × s0 = p × s0 . In other words, we can say that apply the distributive property of dual quaternions and the multi-
while classical quaternions can represent only rotations whose axes plicative property of the norm (Section 3.2):
pass through the origin, dual quaternions can represent rotations
w1 r̂q̂1 + . . . + wn r̂q̂n
with arbitrary axes. DLB(w; r̂q̂1 , . . . , r̂q̂n ) = =
w1 r̂q̂1 + . . . + wn r̂q̂n
Dual quaternions exhibit the so-called antipodal property of classi- w1 q̂1 + . . . + wn q̂n
cal quaternions, i.e., the fact that both q̂ and −q̂ represent the same r̂ = r̂DLB(w; q̂1 , . . . , q̂n )
rigid transformation. Therefore, when converting matrices to dual r̂ w1 q̂1 + . . . + wn q̂n
quaternions, we must choose an appropriate sign. This is however because r̂ = 1, according to our assumption. Demonstration of
the same problem as in the case of regular quaternions, but we can the right invariance proceeds along the same lines. We see that DLB
apply the same methods as in [Hejl 2004] or [Kavan and Zara 2005], is indeed coordinate-invariant.
i.e., consistently select signs so that the resulting quaternions lie in
the same hemisphere. Thirdly, we show that when DLB is applied to two rigid transforma-
tions, it interpolates them along the shortest trajectory. Let therefore
3.3 Blending of Dual Quaternions p̂, q̂ be two unit dual quaternions. We will denote their blending as
DLB(t; p̂, q̂). Thanks to the left invariance of DLB (proven above)
Using Equation (4), we can convert our skinning transformations we can write
to unit dual quaternions q̂1 , . . . , q̂n . The next task is to compute DLB(t; p̂, q̂) = p̂p̂∗ DLB(t; p̂, q̂) = p̂DLB(t; 1, p̂∗ q̂)
a blended unit dual quaternion q̂ with respect to the given convex
weights w = (w1 , . . . , wn ). This can be done by taking their linear It is therefore sufficient to show that the path between 1 (the identity
combination followed by a normalization (because we need a unit transformation) and p̂∗ q̂ will be the shortest one, i.e., given by the
dual quaternion). We call this Dual quaternion Linear Blending screw corresponding to p̂∗ q̂. Since p̂, q̂ are unit dual quaternions,
(DLB): so is p̂∗ q̂ and therefore, according to Equation (5), there exists n̂
(a unit dual quaternion with zero scalar part) and α̂ (a dual scalar)
w1 q̂1 + . . . + wn q̂n such that p̂∗ q̂ = cos α̂2 + n̂sin α̂2 . Therefore, DLB(t; 1, p̂∗ q̂) can be
DLB(w; q̂1 , . . . , q̂n ) =
w1 q̂1 + . . . + wn q̂n re-written as
In the following, we show that DLB has all the properties required 1 − t + t p̂∗ q̂ 1 − t + t cos( α̂2 ) + n̂t sin( α̂2 )
DLB(t; 1, p̂∗ q̂) = =
in skinning (as summarized in Section 3.1). 1 − t + t p̂∗ q̂ 1 − t + t p̂∗ q̂
which means that the screw axis of DLB(t; 1, p̂∗ q̂) is the same for
all t ∈ [0, 1] and is given by n̂ – the only thing that varies is the angle
1−t+t cos( α̂2 )
of rotation and amount of translation, both encoded in 1−t+t p̂∗ q̂
t sin( α̂ )
and 1−t+t p̂2 ∗ q̂ . In other words, DLB(t; 1, p̂∗ q̂) produces a shortest
path screw motion. It should be noted that this screw motion does
not have a constant speed – in an analogy to linear interpolation
of regular quaternions. However, it can be demonstrated that the
velocity of this motion is actually not far from constant [Kavan et al.
2006], which explains why this issue does not present any visible
drawbacks in skinning.
3.4 The Final Algorithm
This section discusses how to efficiently implement dual quater-
nion skinning. First, we need to convert the skinning matrices
C1 , . . . ,Cp (where p is the total number of joints) to dual quater-
nions q̂1 , . . . , q̂ p , unless our application works with them already.
This will typically be done on a CPU and will not take long, be-
cause the conversion to a dual quaternion involves just one quater-
nion multiplication (see Equation (4)) and the number of joints p is
usually quite small. The dual quaternions q̂1 , . . . , q̂ p are then sent to
the GPU as uniform parameters, each represented by a 2 × 4 matrix. Figure 7: Comparison of linear (left) and dual quaternion blending
The skin deformation, i.e., the DLB itself and conversion back to (right). Dual quaternions preserve rigidity of input transformations
the matrix form, takes place in the vertex shader. Since the number and therefore avoid skin collapsing artifacts.
of vertices tends to be orders of magnitude higher than the number
of joints, the vertex shader code should be optimized. The first step Input: dual quaternions q̂1 , . . . , q̂ p (uniform parameters)
of DLB(w; q̂ j1 , . . . , q̂ jn ), i.e., the computation of the linear combi- vertex position v and normal vn
nation b̂ = ∑ni=1 wi q̂ ji , is straightforward. However, the following joints indices j1 , . . . , jn and weights w1 , . . . , wn
normalization, i.e., the computation of b̂ = b̂/b̂, and the subse- Output: transformed vertex position v and normal vn
quent conversion of b̂ to matrix M can be optimized as follows:
b̂ = w1 q̂ j1 + . . . + wn q̂ jn
If b̂ = b0 + ε bε , then the norm b̂ = b0 + ε bb0 ,bε , according to // denote the non-dual part of b̂ as b0 and the dual one as bε
0
Equation (3). The inverse is given by c0 = b0 /b0
cε = bε /b0
1 1 b , bε // denote the components of c0 as w0 , x0 , y0 , z0
= −ε 0 3 // denote the components of cε as wε , xε , yε , zε
b̂ b0 b0
t0 = 2(−wε x0 + xε w0 − yε z0 + zε y0 )
according to Equation (2). Therefore, t1 = 2(−wε y0 + xε z0 + yε w0 − zε x0 )
t2 = 2(−wε z0 − xε y0 + yε x0 + zε w0 )
b̂ 1 b bε b b , bε ⎛ ⎞
b̂ = = (b0 + ε bε ) = 0 +ε − 0 0 3 1 − 2y20 − 2z20 2x0 y0 − 2w0 z0 2x0 z0 + 2w0 y0 t0
b̂ b̂ b 0 b0 b0
M = ⎝ 2x0 y0 + 2w0 z0 1 − 2x20 − 2z20 2y0 z0 − 2w0 x0 t1 ⎠
Now, b̂ = b0 + ε bε needs to be converted to a homogeneous matrix 2x0 z0 − 2w0 y0 2y0 z0 + 2w0 x0 1 − 2x20 − 2y20 t2
M. Its rotational part is given simply by b0 = bb0 . The translation v = Mv // where v has form v = (v0 , v1 , v2 , 1)
0
is given by the vector part of 2bε (b0 )∗ . This simplifies to vn = Mvn // where vn has form vn = (vn,0 , vn,1 , vn,2 , 0)
∗
bε b b , bε b0 bε b∗0 b0 , bε The actual vertex shader code would add some lighting compu-
2bε (b0 )∗ = 2 − 0 0 3 =2 − tations and transformation by the model-view-projection matrix.
b0 b0 b0 b0 2 b0 2
Note that the formulas for t0 ,t1 ,t2 are simply the expanded forms
Since the scalar part of 2bε (b0 )∗ = 0 (according to Equation (4)), it of quaternion product 2cε c∗0 . It is encouraging how simple the re-
b0 ,bε sulting algorithm is.
means that there is no need to evaluate b0 2
, because its purpose
bε b∗0
is only to cancel out the scalar part of b 2 . Therefore, we can 4 Results and Comparison
0
compute the translational part of matrix M just by computing the
b b∗
vector part of 2 bε 02 (and its scalar part can be safely ignored). This In our experiments, we use a female model with 5002 vertices, 9253
0
means that we can avoid the lengthy dual quaternion normalization. triangles and 54 joints. We compare the proposed dual quater-
nion skinning with linear blending, direct quaternion blending
Matrix M is then used to transform the input vertex v. Thanks to [Hejl 2004], log-matrix blending [Cordier and Magnenat-Thalmann
the fact that M is always a rigid transformation matrix, there are 2005] and spherical blend skinning [Kavan and Zara 2005]. Some
no complications with the inverse transposition and normalization artifacts are better visualized on a simple model of cloth (6000 ver-
(as in linear blending [Mohr and Gleicher 2003]) and we can use tices, 12000 triangles and 49 joints). Note that the only variable
M directly to transform also the vertex normal vn . Dual quaternion in our experiments is the transformation blending – the input data
skinning can thus be summarized in the following pseudocode: (model files and postures) are always the same. The visual results
Figure 8: Comparison of direct quaternion blending (left) and dual
quaternion blending (right). Only the latter delivers smooth defor-
mation.
support our hypothesis that our DLB method (which satisfies the Figure 10: Comparison of spherical blending (left) and dual quater-
properties stated in Section 3.1) is indeed free of artifacts, see Fig- nion blending (right). Dual quaternions do not need to cluster ver-
ures 7, 8, 9 and 10. tices and therefore naturally avoid artifacts.
In order to compare computational performance, we have imple- 12 [ms] 0.5 [ms]
mented both CPU and GPU versions of dual quaternion skinning. 11.78
10.83 0.4 0.46
The average times are reported in Figure 11. The performance of 0.39
8
log-matrix vs. spherical blending has been compared only on the 0.3 0.32
CPU, because the GPU implementation of these algorithms has not
been provided in the previous work. Note that our implementa- 4 0.2
4.66 5.07
tion of log-matrix blending uses an optimization for rigid transfor- 3.67 0.1
mations based on the Rodrigues formula, as suggested in [Alexa LBS DQB Log SBS DLB LBS DQB DLB
2002]. 0 0.0
Pentium 4 / 3.4 GHz GeForce 6600 GT
From the measurements, we see that dual quaternion, linear and
direct quaternion blending [Hejl 2004] have quite similar perfor- Figure 11: Average CPU/GPU runtimes for skin deformation of the
mance. Although our algorithm is slightly slower than both linear woman model in milliseconds: LBS – linear blend skinning, DQB
and direct quaternion blending, we believe that this is not a high – direct quaternion blending, Log – log-matrix blending, SBS –
price to pay for the elimination of artifacts. When compared to log- spherical blend skinning, DLB – dual quaternion linear blending.
matrix and spherical blending, we see that dual quaternion skinning
is more than twice as fast (and also much easier to implement).
5 Conclusions
In this paper, we propose a novel skinning method based on the
blending of dual quaternions. We justify its usefulness not only on
practical examples, but also by identifying the mathematical prop-
erties important for skinning and showing that dual quaternions sat-
isfy them. Our method is efficient, very simple to implement and
does not require the modification of existing models or authoring
tools (even though advanced methods exploiting the linearity of lin-
ear blend skinning, such as [Mohr and Gleicher 2003], would have
to be adapted). We therefore believe that it provides a really practi-
cal alternative to the popular but inaccurate linear blend skinning.
The proposed algorithm has several limitations. Dual quaternion
skinning simulates skin-to-skeleton binding in a simplistic way and
is therefore unable to produce realistic musculature or dynamic ef-
fects. Also, dual quaternions are limited only to rigid transforma-
tions and are thus not suitable for models whose parts can scale or
shear (e.g., some cartoon characters).
From a broader point of view, the blending of dual quaternions has
potentially many more applications than just skinning. More gener-
Figure 9: Comparison of log-matrix (left) and dual quaternion ally, it is a method for rigid transformation blending with interesting
blending (right). The shortest-path property of dual quaternion properties. Therefore, it could be potentially useful in contexts such
blending guarantees natural skin deformations. as motion blending, analysis or compression [Alexa 2002]. The in-
vestigation of other applications of dual quaternions in computer H YUN , D.-E., YOON , S.-H., C HANG , J.-W., SEONG , J.-K., K IM, M.-S., AND
graphics promises to be an interesting area for future work. J ÜTTLER , B. 2005. Sweep-based human deformation. The Visual Computer 21,
8-10, 542–550.
J UTTLER , B. 1994. Visualization of moving objects using dual quaternion curves.
6 Acknowledgements Computers & Graphics 18, 3, 315–326.
K AVAN , L., AND Z ARA , J. 2005. Spherical blend skinning: A real-time deformation
We wish to thank Carlo H. Séquin for early illuminating discus-
of articulated models. In 2005 ACM SIGGRAPH Symposium on Interactive 3D
sion on the topic and the anonymous reviewers for their helpful Graphics and Games, ACM Press, 9–16.
comments. We acknowledge the support of the Higher Education
K AVAN , L., C OLLINS , S., O’SULLIVAN , C., AND Z ARA , J., 2006. Dual quaternions
Authority of Ireland. This work has been partly supported by the
for rigid transformation blending. Technical report TCD-CS-2006-46, Trinity Col-
Ministry of Education of the Czech Republic under the research lege Dublin.
programs LC-06008 (Center for Computer Graphics) and MSM
K RY, P. G., JAMES , D. L., AND PAI, D. K. 2002. Eigenskin: real time large de-
6840770014. formation character skinning in hardware. In Proceedings of the 2002 ACM SIG-
References GRAPH/Eurographics symposium on Computer animation, ACM Press, 153–159.
K URIHARA , T., AND M IYATA , N. 2004. Modeling deformable human hands
A LEXA , M. 2002. Linear combination of transformations. In SIGGRAPH ’02: Pro-
from medical images. In SCA ’04: Proceedings of the 2004 ACM SIG-
ceedings of the 29th annual conference on Computer graphics and interactive tech-
GRAPH/Eurographics symposium on Computer animation, ACM Press, New York,
niques, ACM Press, 380–387.
NY, USA, 355–363.
A LLEN , B., C URLESS , B., AND POPOVIĆ , Z. 2002. Articulated body deformation L EWIS , J. P., C ORDNER , M., AND FONG , N. 2000. Pose space deformation: a unified
from range scan data. In SIGGRAPH ’02: Proceedings of the 29th annual con- approach to shape interpolation and skeleton-driven deformation. In Proceedings
ference on Computer graphics and interactive techniques, ACM Press, New York, of the 27th annual conference on Computer graphics and interactive techniques,
NY, USA, 612–619. ACM Press/Addison-Wesley Publishing Co., 165–172.
A LLEN , B., C URLESS , B., POPOVIĆ , Z., AND H ERTZMANN , A. 2006. Learning L I, J., AND H AO , P. 2006. Smooth interpolation on homogeneous matrix groups for
a correlated model of identity and pose-dependent body shape variation for real- computer animation. Journal of Zhejiang University 7, 7, 1168–1177.
time synthesis. In Proceedings of the 2006 ACM SIGGRAPH/Eurographics sym-
M AGNENAT-T HALMANN , N., L APERRIÈRE , R., AND T HALMANN , D. 1988. Joint-
posium on Computer animation, Eurographics Association, Aire-la-Ville, Switzer-
dependent local deformations for hand animation and object grasping. In Proceed-
land, 147–156.
ings on Graphics interface ’88, Canadian Information Processing Society, 26–33.
A NGUELOV, D., SRINIVASAN , P., KOLLER , D., T HRUN , S., RODGERS , J., AND M ARTHINSEN , A. 1999. Interpolation in lie groups. SIAM J. Numer. Anal. 37, 1,
DAVIS , J. 2005. SCAPE: shape completion and animation of people. ACM Trans. 269–285.
Graph. 24, 3, 408–416.
M C C ARTHY, J. M. 1990. Introduction to theoretical kinematics. MIT Press, Cam-
AUBEL, A., AND T HALMANN , D. 2000. Realistic deformation of human body shapes. bridge, MA, USA.
Proc. Computer Animation and Simulation 2000, 125–135. M OAKHER , M. 2002. Means and averaging in the group of rotations. SIAM Journal
BARR , A. H., C URRIN , B., G ABRIEL , S., AND H UGHES , J. F. 1992. Smooth on Matrix Analysis and Applications 24, 1, 1–16.
interpolation of orientations with angular velocity constraints using quaternions. M OHR , A., AND G LEICHER , M. 2003. Building efficient, accurate character skins
ACM Trans. Graph., 313–320. from examples. ACM Trans. Graph. 22, 3, 562–568.
B ELTA , C., AND K UMAR , V. 2002. An SVD-based projection method for interpola- PARK , S. I., AND H ODGINS , J. K. 2006. Capturing and animating skin deformation
tion on SE(3). IEEE Transactions on Robotics and Automation 18, 3, 334–345. in human motion. ACM Trans. Graph. 25, 3, 881–889.
B LOOM, C., B LOW, J., AND M URATORI , C., 2004. Errors and omissions in Marc PRATSCHER , M., C OLEMAN , P., L ASZLO , J., AND SINGH , K. 2005. Outside-
Alexa’s Linear combination of transformations. [Link] in anatomy based character rigging. In SCA ’05: Proceedings of the 2005 ACM
techdocs/lcot_errors.pdf. SIGGRAPH/Eurographics symposium on Computer animation, ACM Press, New
York, NY, USA, 329–338.
BUSS , S. R., AND FILLMORE , J. P. 2001. Spherical averages and applications to
spherical splines and interpolation. ACM Trans. Graph. 20, 2, 95–126. R HEE, T., L EWIS , J., AND N EUMANN , U. 2006. Real-time weighted pose-space
deformation on the GPU. Computer Graphics Forum 25, 3.
C APELL, S., G REEN , S., C URLESS , B., D UCHAMP, T., AND POPOVIC , Z. 2002. In-
SCHEEPERS , F., PARENT, R. E., C ARLSON , W. E., AND M AY, S. F. 1997. Anatomy-
teractive skeleton-driven dynamic deformations. In SIGGRAPH ’02: Proceedings
based modeling of the human musculature. In SIGGRAPH ’97: Proceedings of the
of the 29th annual conference on Computer graphics and interactive techniques,
24th annual conference on Computer graphics and interactive techniques, ACM
ACM Press, New York, NY, USA, 586–593.
Press/Addison-Wesley Publishing Co., New York, NY, USA, 163–172.
C LIFFORD , W. 1882. Mathematical Papers. London, Macmillan. SHOEMAKE , K. 1985. Animating rotation with quaternion curves. In Proceedings
C ORDIER , F., AND M AGNENAT-T HALMANN , N. 2005. A data-driven approach for of the 12th annual conference on Computer graphics and interactive techniques,
real-time clothes simulation. Computer Graphics Forum 24, 2, 173–183. ACM Press, 245–254.
DAM, E., KOCH , M., AND L ILLHOLM , M., 1998. Quaternions, interpolation and SLOAN , P.-P. J., ROSE, III, C. F., AND C OHEN , M. F. 2001. Shape by example.
animation. Technical Report DIKU-TR-98/5, University of Copenhagen. In Proceedings of the 2001 symposium on Interactive 3D graphics, ACM Press,
135–143.
DANIILIDIS , K. 1999. Hand-eye calibration using dual quaternions. International
T ERAN , J., SIFAKIS , E., B LEMKER , S. S., N G -T HOW-H ING , V., L AU , C., AND
Journal of Robotics Research 18, 286–298.
FEDKIW, R. 2005. Creating and simulating skeletal muscle from the visible human
FONTIJNE , D., AND D ORST, L. 2003. Modeling 3D euclidean geometry. IEEE data set. IEEE Transactions on Visualization and Computer Graphics 11, 3, 317–
Comput. Graph. Appl. 23, 2, 68–78. 328.
FORSTMANN , S., AND O HYA , J. 2006. Fast skeletal animation by skinned arc-spline WANG , X. C., AND PHILLIPS , C. 2002. Multi-weight enveloping: least-squares
based deformation. In EG 2006 Short Papers, 1–4. approximation techniques for skin animation. In Proceedings of the 2002 ACM
SIGGRAPH/Eurographics symposium on Computer animation, ACM Press, 129–
G UO , Z., AND WONG , K. C. 2005. Skinning with deformable chunks. Computer
138.
Graphics Forum 24, 3, 373–381.
WAREHAM, R., C AMERON , J., AND L ASENBY, J. 2005. Applications of conformal
H ANSON , A. J. 2006. Visualizing Quaternions. Morgan Kaufmann Publishers Inc. geometric algebra in computer vision and graphics. Lecture Notes in Computer
H EJL, J., 2004. Hardware skinning with quaternions. Game Programming Gems 4, Science 3519, 329–349.
Charles River Media, 487–495. YANG , X., SOMASEKHARAN , A., AND Z HANG , J. J. 2006. Curve skeleton skinning
for human and creature characters: Research articles. Comput. Animat. Virtual
H OFER , M., AND POTTMANN , H. 2004. Energy-minimizing splines in manifolds.
Worlds 17, 3-4, 281–292.
ACM Trans. Graph. 23, 3, 284–293.