Spherical Blend Skinning: A Real-time Deformation of Articulated...

8
Spherical Blend Skinning: A Real-time Deformation of Articulated Models Ladislav Kavan Jiˇ ı ˇ ara Czech Technical University in Prague Abstract Skin deformation based on an underlying skeleton is a common method to animate believable organic models. The most widely used skeletal animation algorithm, linear blend skinning, is also known as skeleton subspace deformation, vertex blending, or en- veloping. It runs in real-time even on a low-end hardware but it is also notorious for its failures, such as the collapsing-joints artifacts. We present a new algorithm which removes these shortcomings while maintaining almost the same time and memory complexity as the linear blend skinning. Unlike other approaches, our method works with exactly the same input data as the popular linear ver- sion. This minimizes the cost of upgrade from linear to spherical blend skinning in many existing applications: the data structures and models need no change at all. The paper discusses also theoret- ical properties of rotation interpolation, essential to spherical blend skinning. CR Categories: I.3.7 [Computer Graphics]: Three-Dimensional Graphics and Realism—Animation Keywords: skinning, deformation, skeletal animation 1 Introduction Real-time animation of deformable objects is always a compromise between visual fidelity and computation complexity. Other aspects are quite important as well, for example the amount of artists work necessary to design the model. Therefore, there exist many algo- rithms for modeling deformable objects in the literature. They dif- fer by the intended area of application and generality of allowed models. We focus on the real-time animation systems in this paper. Its most popular representative, known generally as the skeletal animation, is based on simple but versatile structure. It consists of joints, given by their position and orientation. The segments connecting the joints are conveniently interpreted as bones. The skeleton is, formally speaking, a tree whose nodes are identified with the joints and edges with the bones. The only displayed element is a skin,a 3D polygonal mesh, usually equipped with normal and texture data. Although the terminology is adopted from the virtual humanoid modeling, the skeletal animation is not limited to character ani- mation – it can be applied to a wide range of soft objects, includ- ing imaginary (cartoon) creatures, plants, furniture, etc. This is an apparent advantage over complex systems which rely on explicit anatomy. e-mail: [email protected] The skeleton simplifies the animation task considerably: instead of animating each vertex individually, it is sufficient to manipulate the skeleton, and the skin deforms automatically. The skeletal anima- tion in general does not specify how exactly the skeleton posture should be propagated to the skin. However, there is an established standard used in majority of real-time 3D applications. It comes by many names, all relating to the same algorithm: linear blend skinning (LBS), skeleton subspace deformation, vertex blending, enveloping, or simply skinning. Basically, this algorithm blends between rigidly transformed vertices using vertex weights, which denote the amount of influence of individual joints. Although LBS is very fast and advantageous to graphics hardware, it suffers from inherent artifacts, known as ”collapsing joints”, ”twisting elbow problem” or a ”candy-wrapper artifact”. In gen- eral, the mesh deformed by LBS loses volume as the joint rotation increases. The cause of this phenomena is explained in section 3, together with the LBS algorithm itself. The structure of the paper is as follows: in the next section, we summarize the previous work concerning real-time skin deforma- tion and sketch our solution. In section 3, we analyze the problems of the LBS algorithm. Our approach to resolve these problems is presented in section 4. In section 5, we compare the results and discuss possible enhancements. 2 Related Work An early contribution concerning the animation of deformable ob- jects is [Magnenat-Thalmann et al. 1988], which considers the movement of a human hand. First 3D characters used in numer- ous computer games were animated by simple, often unpublished algorithms. Later on, the basic principles of LBS were described by the game development community [Lander 1998; Lander 1999]. The artifacts of LBS were discovered soon [Weber 2000]. An im- provement based on addition of auxiliary joints has been also pro- posed in [Weber 2000]. Although this reduces the artifacts, the skin to joints relationship must be re-designed after joint addition. The number and location of the additional joints remains question- able. Another problem is how the movement of the original skele- ton should be propagated into the augmented one. More formal articles consider skin deformation as an interpolation problem, such as [Lewis et al. 2000]. They use radial basis func- tions to interpolate between example skins with different shapes. Similar method is presented in [Sloan et al. 2001] and [Kry et al. 2002]. The latter de-correlates the deformation displacements using principal component analysis, which reduces the memory require- ments considerably. The advantage of example based methods is that they capture the designed shape, including effects like muscle bulging. The drawback is the necessity of acquiring the example skins. An interesting generalization of LBS is called multi-weight en- veloping [Wang and Phillips 2002]. It introduces more parame- ters and therefore greater flexibility to the deformation algorithm. Instead of one weight per influence (joint) as in LBS, the multi- weight enveloping uses twelve. These numerous parameters are derived from examples using the least squares optimization. The

Transcript of Spherical Blend Skinning: A Real-time Deformation of Articulated...

Page 1: Spherical Blend Skinning: A Real-time Deformation of Articulated …ladislav/kavan05spherical/kavan... · 2014-07-23 · of rotation in real-time. The second problem is simple in

Spherical Blend Skinning: A Real-time Deformation of Articulated Models

Ladislav Kavan∗ Jirı Zara

Czech Technical University in Prague

Abstract

Skin deformation based on an underlying skeleton is a commonmethod to animate believable organic models. The most widelyused skeletal animation algorithm, linear blend skinning, is alsoknown as skeleton subspace deformation, vertex blending, or en-veloping. It runs in real-time even on a low-end hardware but it isalso notorious for its failures, such as the collapsing-joints artifacts.We present a new algorithm which removes these shortcomingswhile maintaining almost the same time and memory complexityas the linear blend skinning. Unlike other approaches, our methodworks with exactly the same input data as the popular linear ver-sion. This minimizes the cost of upgrade from linear to sphericalblend skinning in many existing applications: the data structuresand models need no change at all. The paper discusses also theoret-ical properties of rotation interpolation, essential to spherical blendskinning.

CR Categories: I.3.7 [Computer Graphics]: Three-DimensionalGraphics and Realism—Animation

Keywords: skinning, deformation, skeletal animation

1 Introduction

Real-time animation of deformable objects is always a compromisebetween visual fidelity and computation complexity. Other aspectsare quite important as well, for example the amount of artists worknecessary to design the model. Therefore, there exist many algo-rithms for modeling deformable objects in the literature. They dif-fer by the intended area of application and generality of allowedmodels.

We focus on the real-time animation systems in this paper. Its mostpopular representative, known generally as the skeletal animation,is based on simple but versatile structure. It consists of joints,given by their position and orientation. The segments connectingthe joints are conveniently interpreted as bones. The skeleton is,formally speaking, a tree whose nodes are identified with the jointsand edges with the bones. The only displayed element is a skin, a3D polygonal mesh, usually equipped with normal and texture data.

Although the terminology is adopted from the virtual humanoidmodeling, the skeletal animation is not limited to character ani-mation – it can be applied to a wide range of soft objects, includ-ing imaginary (cartoon) creatures, plants, furniture, etc. This is anapparent advantage over complex systems which rely on explicitanatomy.

∗e-mail: [email protected]

The skeleton simplifies the animation task considerably: instead ofanimating each vertex individually, it is sufficient to manipulate theskeleton, and the skin deforms automatically. The skeletal anima-tion in general does not specify how exactly the skeleton postureshould be propagated to the skin. However, there is an establishedstandard used in majority of real-time 3D applications. It comesby many names, all relating to the same algorithm: linear blendskinning (LBS), skeleton subspace deformation, vertex blending,enveloping, or simply skinning. Basically, this algorithm blendsbetween rigidly transformed vertices using vertex weights, whichdenote the amount of influence of individual joints.

Although LBS is very fast and advantageous to graphics hardware,it suffers from inherent artifacts, known as ”collapsing joints”,”twisting elbow problem” or a ”candy-wrapper artifact”. In gen-eral, the mesh deformed by LBS loses volume as the joint rotationincreases. The cause of this phenomena is explained in section 3,together with the LBS algorithm itself.

The structure of the paper is as follows: in the next section, wesummarize the previous work concerning real-time skin deforma-tion and sketch our solution. In section 3, we analyze the problemsof the LBS algorithm. Our approach to resolve these problems ispresented in section 4. In section 5, we compare the results anddiscuss possible enhancements.

2 Related Work

An early contribution concerning the animation of deformable ob-jects is [Magnenat-Thalmann et al. 1988], which considers themovement of a human hand. First 3D characters used in numer-ous computer games were animated by simple, often unpublishedalgorithms. Later on, the basic principles of LBS were describedby the game development community [Lander 1998; Lander 1999].The artifacts of LBS were discovered soon [Weber 2000]. An im-provement based on addition of auxiliary joints has been also pro-posed in [Weber 2000]. Although this reduces the artifacts, theskin to joints relationship must be re-designed after joint addition.The number and location of the additional joints remains question-able. Another problem is how the movement of the original skele-ton should be propagated into the augmented one.

More formal articles consider skin deformation as an interpolationproblem, such as [Lewis et al. 2000]. They use radial basis func-tions to interpolate between example skins with different shapes.Similar method is presented in [Sloan et al. 2001] and [Kry et al.2002]. The latter de-correlates the deformation displacements usingprincipal component analysis, which reduces the memory require-ments considerably. The advantage of example based methods isthat they capture the designed shape, including effects like musclebulging. The drawback is the necessity of acquiring the exampleskins.

An interesting generalization of LBS is called multi-weight en-veloping [Wang and Phillips 2002]. It introduces more parame-ters and therefore greater flexibility to the deformation algorithm.Instead of one weight per influence (joint) as in LBS, the multi-weight enveloping uses twelve. These numerous parameters arederived from examples using the least squares optimization. The

Page 2: Spherical Blend Skinning: A Real-time Deformation of Articulated …ladislav/kavan05spherical/kavan... · 2014-07-23 · of rotation in real-time. The second problem is simple in

disadvantage is obvious: while the LBS models can be weightedmanually by artists [Steed 2002], this is questionable with multi-weight enveloping. Tools that help animators to design the vertexweights are described in [Mohr et al. 2003]. This article is inter-esting also from the theoretical point of view, because it describeshow to explore the space of all possible LBS deformations.

Another deformation algorithm [Bloomenthal 2002] uses a com-plex auxiliary structure – a medial. An idea similar to sphericalblend skinning (SBS) is bones blending proposed by [Kavan andZara 2003]. However, bones blending is limited to vertices attachedto only two joints. In addition, it requires hand-tuning of special pa-rameters. Another algorithm removes the LBS artifacts by addingadditional joints, and computes the vertex weights automatically us-ing examples [Mohr and Gleicher 2003]. A recent skin deformationalgorithm presented in [Magnenat-Thalmann et al. 2004] seems togive results competitive to SBS, although it is based on a differentmathematical fundament [Alexa 2002]. However, this method isconsiderably slower than LBS and therefore [Magnenat-Thalmannet al. 2004] recommends to use rather the standard LBS if the jointrotations are small.

To conclude, there are many methods correcting the problems ofLBS, but none of them is superior to LBS in all aspects. As a result,the linear blend skinning is still widely used in many applications,in spite of the artifacts.

2.1 Our Contribution

We observed that the artifacts of LBS are caused by the straightfor-ward, linear interpolation of vertex positions. Intuitively, a linearblending is not suitable to capture deformations induced by skele-ton, because their nature is rather spherical. Our basic idea is tochange the interpolation domain: we interpolate transformations it-self instead of transformed vertex positions. Because we considertransformations consisting of a translation and rotation, we suggestto use a quaternion representation.

The transition to non-linear interpolation domain is not elementary.In order to achieve our goal, we cope with two main problems:determination of the center of rotation, and interpolation of multi-ple quaternions. The first problem follows from the fact that thechoice of the center of rotation influences the result of interpola-tion considerably. We show how to compute a convenient centerof rotation in real-time. The second problem is simple in the caseof two quaternions [Shoemake 1985], but gets considerably harderfor more than two rotations [Buss and Fillmore 2001; Park et al.2002; Alexa 2002]. Because the previous methods are not efficientenough for our purpose, we use a simple linear quaternion aver-aging. We justify both theoretically and experimentally that thissolution is appropriate for our task (and probably for many others).

Resolving those problems, we obtain a skin animation algorithmthat deforms the mesh in much more plausible way then LBS. Be-cause we change only the interpolation domain and not the inputdata, our program works with exactly the same models as LBS. Theproposed algorithm improves a deformed shape even of models thathave been designed and carefully tuned for LBS. Considering thehigh speed and low memory demands of SBS, it provides an attrac-tive alternative to classic LBS.

2.2 Conventions

Let us denote matrices by capital letters, while vectors and quater-nions by bold. Vectors are considered column vectors, therefore a

multiplication of vector v by matrix M is written as Mv. We donot introduce a different notation for the R3 vectors and their ho-mogeneous R4 counterparts with last coordinate equal to 1. Thesame convention is used for matrices. We denote the dot product oftwo vectors v1,v2 as (v1,v2) and the norm ‖v1‖ as a shortcut for√

(v1,v1).

3 Linear Blend Skinning

The input to LBS consists of a polygonal mesh representing thedigital skin, a skeleton, and vertex weights for every vertex of theskin. The polygonal mesh and the skeleton are designed in a refer-ence position, e.g. virtual characters are often posed in the da Vinciposture [Steed 2002].

Let us label the joints by integer numbers, assigning zero to theroot. Each joint in the reference posture is associated with a homo-geneous matrix, describing its position and orientation in the worldcoordinate system. For j-th joint, we denote this matrix by A j, like”absolute” (or reference) position. This matrix is computed by mul-tiplying all the transformations of individual joints in the chain fromroot to joint j. To compute the shape of the deformed skin, we needyet another set of matrices, describing the position and orientationof joints in the actual, animated posture. We call them Fj , standingfor the ”final” placement of joint j. Matrices Fj are computed in asimilar way as the absolute matrices, but including the actual rota-tion of each joint in the chain (we do not consider translating andscaling joints).

The most simple skin deformation algorithm computes

v′ = FjA−1j v

where v is a vertex in the reference skin associated with joint jand v′ is its position in the deformed mesh. The interpretation isfollowing: the first matrix A−1

j transforms v to the position withjoint j’s coordinate system aligned to the world coordinate system.The following transformation Fj returns the vertex to its currentposition induced by the animated skeleton. Because these trans-formations usually occur together, we define the ”complete” matrixCj = FjA

−1j . Some older computer games animated characters in

this way, even though it does not produce nice, smooth deforma-tions.

The linear blend skinning allows assignment of one vertex to mul-tiple bones. Assume that vertex v is attached to joints j1, . . . , jnwith weights w1, . . . ,wn. The weights are coefficients of a convexcombination, i.e. non-negative and ∑n

i=1 wi = 1. The weight wi rep-resents the amount of influence of joint ji. The vertex position inthe mesh deformed by LBS is then computed as

v′ =n

∑i=1

wiCji v (1)

that is to say, making a convex combination of individual vertextransformations. For example if n = 2 then vertex v′ lies on theline segment connecting Cj1 v and Cj2 v. The actual position on thesegment is given by weight w1 (or w2, because w1 +w2 = 1). As ex-plained in the next section, the SBS works on a circular arc insteadof segment, see Figure 1.

If the joint rotations are large, the LBS produces non-natural defor-mations. In the extremal case of rotation by 180 degrees, the skincan collapse to a single point. It is the notorious ”candy-wrapper”artifact, which is demonstrated in Figure 2. The right shoulder of

Page 3: Spherical Blend Skinning: A Real-time Deformation of Articulated …ladislav/kavan05spherical/kavan... · 2014-07-23 · of rotation in real-time. The second problem is simple in

j1 j2

bone jointmesh

vertex v

LBS workspace SBS workspace

C v

C vj1

j2

Figure 1: The set of possible results of LBS is a line segment, whileSBS gives a circular arc.

the model is twisted by 180 degrees, while the left shoulder is leftin the reference pose.

To understand why this undesirable effect occurs, it is sufficient tore-arrange the equation (1)

v′ =

(n

∑i=1

wiCji

)v (2)

This formula is less efficient, because it blends matrices insteadof vectors, but gives us a valuable insight. It is well known thatthe component-wise interpolation of matrices produces odd results:it does not preserve the orthogonality of the rotational part of thematrix. In some situations, it does not preserve even the rank of theinterpolated matrices. This is exactly what happens in the ”candy-wrapper” problem: the single point the skin collapses to is a resultof transformation by a singular matrix. A similar defect is visiblealso in the proximity of the singular configuration. Although thematrix is regular, it involves a non-uniform scaling and skewing,which is responsible for the loss of volume of the deformed skineven for small rotations.

4 Spherical Blend Skinning

Instead of trying to correct the bad results of LBS, we propose tochange the interpolation method in (2). We focus on the interpo-lation of rotations – the linear interpolation of the translation partof Cji matrices is all right. An established interpolation of two ro-tations is spherical linear interpolation (SLERP) [Shoemake 1985].Its key of success is the use of quaternions to represent rotations.Unfortunately, it is not possible to simply replace matrices Cji in (2)with corresponding pairs quaternion-translation. One of the prob-lems is that the linear interpolation of quaternions is not equivalentto SLERP. However, this is not the most serious difficulty, and we

Figure 2: Up – an extreme shoulder twist deformed by LBS, down– the same posture deformed by SBS

address it in section 4.1. The more important problem is to computea convenient center of the interpolated rotations.

We show that this is really an important problem on an example ofhuman arm. Consider that the arm geometry is influenced by twojoints j1 and j2, such that j1 is a parent of j2, as in Figure 1. Thetransformation of the whole mesh by Cj1 is illustrated in the top rowof Figure 3 and the transformation of the same geometry by Cj2 inthe bottom row (note that the results are identical in both columnsof these rows). The rows in the middle show the progress of inter-polation between Cj1 to Cj2 . The only difference between the twocolumns in Figure 3 is in the choice of the center of rotation. Inthe left column, the rotation center rc is set to the translation part ofmatrix A j2 (the position of joint j2 in the reference posture). Notethat Cj1 rc = Cj2 rc, therefore also the transformed rotation center isconstant during the interpolation. In the right column of the figure,the rotation center rc is set to the translation part of A j1 . BecauseCj1 rc �= Cj2 rc, the transformed rotation center is linearly interpo-lated from Cj1 rc to Cj2 rc. By comparison with the starting mesh(drawn gray in each frame), it is obvious that the center of rotationchoice in the left column is much more advantageous. In this case,the interpolation of every single point is a circular arc (as in Fig-ure 1), whereas a disturbing drift is inherent to any other choice ofrotation center (such as rc).

Unfortunately, the condition of zero translation cannot be alwayssatisfied, typically for more than two influencing joints. But even ifthe vertex is attached to only two joints k and l that are not neigh-bours of each other, some translation may be inevitable. For exam-ple consider that there is no relative rotation between Ck and Cl , butthere is a relative translation induced by the joints in the chain be-tween k and l. Clearly no choice of the center of rotation can avoidthis translation, because the rotation is identity.

Anyway, it is possible to define the rotation center as the pointwhose transformations by associated matrices are as close as pos-sible. This minimizes the drift and works even if the vertex is as-signed to n joints j1, . . . , jn. We find the center of rotation rc as the

Page 4: Spherical Blend Skinning: A Real-time Deformation of Articulated …ladislav/kavan05spherical/kavan... · 2014-07-23 · of rotation in real-time. The second problem is simple in

rc

Cj1

Cj2

Cj1

Cj2

rcCj1rcCj1

Cj2

rcCj2

Figure 3: The correct center of rotation is chosen in the left column,while the sub-optimal in the right column. In the middle rows, no-tice the difference of the elbow position with respect to the originalskin.

least-squares solution of the system of(n

2

)linear vector equations

Carc = Cbrc, a < b, a,b ∈ { j1, . . . , jn}Each homogeneous matrix Ci has structure

Ci =(

Croti Ctr

i0T 1

)

where Croti is a 3 × 3 orthogonal matrix and Ctr

i is a translationvector. This enables us to re-write the linear system to

Crota rc +Ctr

a = Crotb rc +Ctr

b

(Crota −Crot

b )rc = Ctrb −Ctr

a

If we stack all these equations to one matrix D and the right-handsides to vector e, we can write the whole system as

Drc = e

where D is a 3(n

2

)×3 matrix, rc is a 3-dimensional unknown vectorand e is 3

(n2

)-dimensional vector. In general, we cannot make any

assumptions about the rank of matrix D, which can vary from 0 to 3(consider for example n = 2 and Cj1 = Cj2 ). We search the optimalsolution rc in the least-squares sense. If there are multiple solu-tions giving the minimal ‖Drc − e‖, the rc with the minimal normis chosen. This can be done in a robust way using the singular valuedecomposition (SVD), followed by computation of pseudo-inversematrix. To perform these computations, we use the LAPACK soft-ware [Anderson et al. 1999].

Even though LAPACK routines are efficient, computation of thecenter of rotation per each vertex would not result in a real-time al-gorithm. Fortunately, the center of rotation depends only on thetransformations of the joints j1, . . . , jn and not the vertex itself.Therefore, if we encounter another vertex assigned to the same setof joints j1, . . . , jn, we can re-use the center of rotation computedformerly (cached). Moreover, if there is only one, or two neighbor-ing joints that influence the vertex, we can determine the center ofrotation precisely (as indicated in the beginning of this section) andomit the SVD computation at all. It turns out that the number ofdifferent non-trivial joint sets, and therefore the number of runningthe SVD, is surprisingly small for common models – about severaltens. This enables the real-time performance.

4.1 Interpolation of Multiple Rotations

As mentioned in the introduction, the interpolation of multiple rota-tions has already received some attention [Buss and Fillmore 2001;Park et al. 2002] as well as interpolation of multiple general trans-formations [Alexa 2002]. Unfortunately, all these methods are sub-stantially slower then the simple linear interpolation used in LBS.Since our goal is an algorithm with comparable time complexity asLBS, we propose an approximate but fast linear quaternion blend-ing. For the case of two rotations, we compare our method with theestablished SLERP.

Recall that a rotation around axis a (unit length vector) with angle2α corresponds to quaternion q′ = cosα + asinα . However, thiscorrespondence is not unique, because both quaternions q′ and −q′represent the same rotation. The SLERP of two unit quaternionsp,q assumes that their dot product (p,q) ≥ 0. If the dot product(p,q) < 0, we use −p instead of p, which is possible because bothp and −p represent the same rotation. The SLERP of p,q withinterpolation parameter t ∈ 〈0,1〉 is given by the following formula,see for example [Eberly 2001].

s(t;p,q) =sin((1− t)θ)p+ sin(tθ)q

sinθ(3)

where θ is the angle inclined by quaternions p,q, i.e. cosθ = (p,q).

The linear interpolation of quaternions (QLERP) is computed as

l(t;p,q) =(1− t)p+ tq

‖(1− t)p+ tq‖ (4)

The difference to SLERP is obvious: QLERP interpolates along theshortest segment, and then projects to arc, which does not result inthe uniform interpolation of the arc. In spite of this, we claim thatQLERP is sufficient for our task. In order to justify this statement,we face an interesting question by itself: how big can be the differ-ence between QLERP and SLERP for the same input rotations?

Page 5: Spherical Blend Skinning: A Real-time Deformation of Articulated …ladislav/kavan05spherical/kavan... · 2014-07-23 · of rotation in real-time. The second problem is simple in

For t = 0, both QLERP and SLERP return of course p. For t > 0, wecan imagine that both QLERP and SLERP work by concatenatingp with some rotation (multiplying p with some quaternion). ForSLERP, we denote this quaternion as rs(t). It can be expressed asp∗s(t;p,q), because

prs(t) = pp∗s(t;p,q) = s(t;p,q)

The rotation rs(t) can be written out as

rs(t) = p∗s(t;p,q) =sin((1− t)θ)1+ sin(tθ)p∗q

sinθ(5)

The quaternion 1 represents the identity (zero angle rotation). Fromthe definition of quaternion multiplication it can be seen that the realpart of p∗q equals (p,q) = cosθ . Since p∗q is a unit quaternion,we can express it as

p∗q = cosθ +usinθ

for some axis of rotation u. If we substitute this into equation (5),we obtain

rs(t) =sin((1− t)θ)+ sin(tθ)cosθ

sinθ+usin(tθ)

which means that the direction of the axis u is independent on t.

Let us examine the rotation rl(t) following p in QLERP:

rl(t) = p∗l(t;p,q) =(1− t)1+ tp∗q‖(1− t)p+ tq‖ =

=(1− t + t cosθ)‖(1− t)p+ tq‖ +u

t sinθ‖(1− t)p+ tq‖

which shows that the axis of rotation has the same direction. Wecan conclude with an important property: the SLERP can be writtenas prs(t) and QLERP as prl(t), where the rotations rs(t) and rl(t)have the same axis. Moreover, this axis is constant, i.e. independenton the interpolation parameter t.

It follows that the only difference between QLERP and SLERP isin the angle of rotations rs(t) and rl(t). Note that both rs(t) andrl(t) have a form of linear combination of quaternions 1 and p∗q.It means that the results of both rs(t) and rl(t) always end up incertain 2D subspace of R4. We can restrict our attention to thissubspace (the linear hull of 1 and p∗q).

Since SLERP assumes cosθ = (p,q) ≥ 0, the angle θ cannot ex-ceed π/2. To obtain an upper bound of the maximal difference inthe angle, we consider the extremal case with θ = π/2, depictedin Figure 4.

The angle α(t) on the picture can be computed by atan, and β (t)by simple linear interpolation of the right angle, which yields thedifference function

d(t) = α(t)−β (t) = atan

(t

1− t

)− π

2t

It remains to find the extremes of d(t) on the interval 〈0,1〉. Theelementary mathematical analysis discovers the global extremes inpoints 1/2±√(1/π − 1/4). The absolute value of d(t) in thesepoints is approximately 0.071 radians (4.07 degrees). As mentionedin the introduction of this section the angle of rotation is twice theangle inclined by quaternions.

To conclude: both SLERP and QLERP interpolate by multiplyingthe first quaternion with a rotation with the same, fixed axis. Thedifference between SLERP and QLERP is only in the angle of this

t

1-t

1

1

�(t)

SLERP

QLERP

�(t)

Figure 4: The difference between QLERP angle α(t) and SLERPβ (t)

rotation, and is strictly less then 0.143 radians (8.15 degrees) forany interpolation parameter t ∈ 〈0,1〉. This is an upper bound;practical results are much smaller and could hardly cause an ob-servable defect in the deformed skin. The big advantage of QLERPis that it can be easily generalized to interpolate multiple rotations– it suffices to make a convex combination and re-normalization ofmultiple quaternions.

4.2 Algorithm Overview

Now we have prepared all the ingredients to describe how the SBSalgorithm works. The task is to transform a vertex v influenced byjoints j1, . . . , jn with convex weights W = (w1, . . . ,wn) to its posi-tion v′ in the animated skin. In order to obtain an appealing defor-mation, it is necessary to respect the computed center of rotation rc.To achieve this, we extend the QLERP scheme to homogeneous ma-trices Cji . We denote the interpolation of matrices Cji with weightsW as

q(W ;Cj1 , . . . ,Cjn) =(

Q m0T 1

)(6)

and compute Q and m as follows. First, the rotation submatricesCrot

ji are converted to quaternions q ji . One of them, for exampleq j1 , is chosen as pivot. If (q j1 ,q ji) < 0 for any i = 2, . . . ,n, wereplace q ji with −q ji (by analogy to SLERP). Then the QLERPcomputes s = w1q j1 + . . .+ wnq jn , which is subsequently normal-ized to sn = s/‖s‖. Finally, sn is converted to the rotation matrix Q.The translation part is just linearly interpolated, m = ∑n

i=1 wiCtrji .

In order to change the center of rotation from the origin to rc, wedefine a homogeneous matrix

T =(

I rc0T 1

)(7)

where I is a 3×3 identity matrix. Then the interpolation of homo-geneous matrices with respect to the center of rotation rc can bewritten as

T q(W ;T−1Cj1 T, . . . ,T−1Cjn T )T−1 (8)

Note that the shift of the center of rotation does not influence theinterpolated rotation – it manifests only in the translation part. Thedesired transformation of vertex v is

v′ = T q(W ;T−1Cj1 T, . . . ,T−1Cjn T )T−1v

Page 6: Spherical Blend Skinning: A Real-time Deformation of Articulated …ladislav/kavan05spherical/kavan... · 2014-07-23 · of rotation in real-time. The second problem is simple in

= Q(v− rc)+n

∑i=1

wiCji rc (9)

A detailed derivation of this formula can be found in appendix A.The latter addend represents the translation induced by the new cen-ter of rotation.

The equation (9) has to be evaluated once per each vertex, andtherefore should be as efficient as possible. The basic optimizationis to pre-compute the quaternions q ji , because they do not dependon the actual vertex – only on the joint’s transformation, similarlyas the rotation centers rc. Nonetheless, QLERP has to be executedfor each vertex, since weights w1, . . . ,wn can vary. In order to chal-lenge the speed of LBS, we apply a following trick.

The vertex v can be represented by a quaternion with zero real part.In this representation, its rotation by quaternion q′ can be expressedas q′vq′∗, which is a quaternion with zero real part as well [Eberly2001]. Although this expression is not efficient for computation(because of slow quaternion multiplication), it enables us to writeout the rotation of v by quaternion sn as

snvsn∗ =

1‖s‖2 svs∗ =

1(s,s)

svs∗

This suggests to convert already the quaternion s to matrix Q′ andnormalize subsequently by dividing (s,s). Therefore, we can com-

pute the Q matrix from (9) as Q = Q′(s,s) and save the sqrt operation.

Some attention must be paid because standard routines for quater-nion to matrix conversion assume a unit-length quaternion. Theconversion of an arbitrary length q′ = w + xi + y j + zk leads to thefollowing matrix:⎛⎝ x2 +w2 − y2 − z2 2xy−2wz 2xz+2wy

2xy+2wz y2 +w2 − x2 − z2 2yz−2wx2xz−2wy 2yz+2wx z2 +w2 − x2 − y2

⎞⎠

Vertex normal vn is transformed in a similar way as vertex position,but ignoring the translation

v′n = Qvn

Using the formula (9) we can verify our previous intuitive thinking.First, if we substitute rc in place of v, no rotation occurs, whichmeans that rc is indeed a center of rotation. Second, if n = 2 andCj1 rc = Cj2 rc (as in the beginning of section 4), the translation partbecomes

w1Cj1 rc +w2Cj2 rc = (w1 +w2)Cj1 rc = Cj1 rc

which is independent of interpolation parameters (weights), i.e.the translation during interpolation is constant indeed. Third, theequation (9) is nothing but a generalization of LBS to an arbitrarymethod of rotation interpolation. The choice of QLERP is not im-portant for (9), the matrix Q can be replaced by matrix resultingfrom any other interpolation scheme, such as [Buss and Fillmore2001]. If we substitute Q = ∑wiCrot

ji , i.e. a simple linear combina-tion of rotation matrices, we obtain

v′ = Q(v− rc)+∑wiCji rc = ∑wiCrotji v−∑wiCrot

ji rc +

∑wiCrotji rc +∑wiCtr

ji = ∑wiCrotji v+∑wiCtr

ji = ∑wiCji v

which is exactly the LBS equation (1). This also shows that LBS isa special case, which is independent of the center of rotation.

The whole algorithm can be summarized in the following steps:

Figure 5: 3D models used for testing

Hand Woman Creaturevertices 2402 3356 6802triangles 4800 5205 13590joints 23 78 56

Table 1: Complexities of example models

• compute matrices Ci for all joints and convert their rotationparts to quaternions qi

• for each vertex v influenced by joints j1, . . . , jn

– compute (or re-use a cached) center of rotation rc ac-cording to section 4

– blend quaternions q j1 , . . .q jn using QLERP and convertthe result to matrix Q

– compute the position of vertex v′ in the deformed skinusing the equation (9)

5 Results and Comparison

We tested the SBS algorithm on three models, see Figure 5 and Ta-ble 1. We compare the shape of the deformed skin on the model ofwoman, because human eye is most sensitive to the deformationsof human body. Figure 6 presents results of LBS and SBS executedon the same posture of the model. Another example has been pre-sented already in Figure 2. For small deformations, both algorithmsproduce similar results, as in the second row of Figure 6 (althougha small loss of volume is noticeable even there). It is remarkablethat the results of SBS are better even though the models have beenoptimised to work with the LBS algorithm.

The performance of both algorithms is compared in Table 2. Themeasured value is an average time in milliseconds necessary to de-form one model on a 2.5GHz Athlon PC (rendering time not in-cluded). In the last row of the table the number of different non-trivial joint sets is reported (trivial joint set consists of only one joint

Page 7: Spherical Blend Skinning: A Real-time Deformation of Articulated …ladislav/kavan05spherical/kavan... · 2014-07-23 · of rotation in real-time. The second problem is simple in

Figure 6: Comparison of deformations by LBS (left) and SBS(right)

or two neighboring joints). Put in another way, it is exactly the num-ber of singular-value decompositions performed by the SBS algo-rithm. This number participates considerably on the difference be-tween times for LBS and SBS. Theoretically, the number of differ-ent non-trivial joint sets could be very high. Fortunately, this num-ber is surprisingly small in practice, because the joint influencestend to be local (e.g. it is unlikely to find vertices influenced byboth left and right wrist). The additional memory needed for SBSis dominated by caching the computed centers of rotation. How-ever, this amount of memory is negligible, considering the numberof different non-trivial joint sets.

In order to test the accuracy of QLERP, we experimented withspherical weighted averages presented in [Buss and Fillmore 2001].The algorithm proposed in [Buss and Fillmore 2001] behaves likeSLERP for the case of two rotations (in contrast to QLERP, which

Hand Woman CreatureLBS time 3.28 3.59 9.0SBS time 4.43 4.54 11.37SVD executions 38 37 56

Table 2: First two rows: run-time of LBS and SBS algorithms inmilliseconds; last row: number of SVD executions

only approximates SLERP results). On the one hand, the differ-ence in the deformed skin was barely observable, according to theresults from section 4.1. On the other hand, the increase in the ex-ecution time was quite substantial. For the woman model, the timeincreased from original 4.54ms to 22.74ms. This only confirmedour choice of QLERP.

5.1 Conclusion and Future Work

The proposed skin deformation system is by no means perfect; itcannot compete with complex, layered models. However, the SBSalgorithm offers reasonable price for elimination of the notoriousLBS artifacts. The time and memory complexity of both algorithmsis comparable. The overhead of replacing an existing LBS imple-mentation by SBS is minimal, because the input data, as well asthe internal data structures, are the same. In contrast to other meth-ods, the SBS does not need any additional information, such as theexample skins.

The presented algorithm opens many questions and suggests sev-eral directions of future work. First of all, we worked only withvertex weights optimised for LBS. These weights are designed tosuppress the LBS artifacts, even though they cannot remove them.It would be interesting to find out how much can be the SBS resultsimproved by a set of weights especially designed for SBS. In orderto accomplish this, a tool to explore the space of SBS deformationswould help considerably. This tool has been presented for LBSin [Mohr et al. 2003], but the situation of SBS is somewhat morecomplex, because our interpolation method is non-linear. Similarly,it would be possible to estimate the SBS vertex weights from exam-ples, as was done for LBS in [Mohr and Gleicher 2003]. This couldalso cover additional effects like muscle bulging.

6 Acknowledgments

This work has been partly supported by the Ministry of Education,Youth and Sports of the Czech Republic under research programNo.Y04/98:212300014 (Research in the area of information tech-nologies and communications).

We thank to Samuel Buss for providing the algorithm for sphericalweighted averages [Buss and Fillmore 2001] and to LAPACK de-velopers for their software. We would also like to thank to JaroslavSemancık and the anonymous reviewers for valuable comments andto Adam J. Sporka for help with the accompanying video.

A Interpolation of Rotations with an Arbi-trary Center

In this appendix we derive the formula (9), which describes theinterpolation of rotations with respect to rc – a custom center ofrotation. Let us denote by K the coordinate system with origin inrc and identical basis vectors as the world coordinate system. Then

Page 8: Spherical Blend Skinning: A Real-time Deformation of Articulated …ladislav/kavan05spherical/kavan... · 2014-07-23 · of rotation in real-time. The second problem is simple in

the matrix T (7) can be interpreted as a transformation from K tothe world coordinate system. By analogy, the inverse matrix

T−1 =(

I −rc0T 1

)

represents the transformation from the world coordinate system toK. It follows that T−1Cji T is the transformation Cji expressed withrespect to K. By interpolating these matrices with QLERP

q(W ;T−1Cj1 T, . . . ,T−1Cjn T )

we obtain a matrix working also on vectors in K coordinates. Wecan express this matrix with respect to the world coordinate systemeasily

T q(W ;T−1Cj1 T, . . . ,T−1Cjn T )T−1

which is exactly the formula (8).

Recall that the matrix Cji has structure

Cji =(

Crotji Ctr

ji0T 1

)

which enables us to write out

T−1Cji T =(

Crotji Cji rc − rc

0T 1

)

as can be simply verified. Please note that the change of the coordi-nate system did not influence the rotation part Crot

ji at all. Thereforethe result of QLERP will be, according to equation (6)

q(W ;T−1Cj1 T, . . . ,T−1Cjn T ) =(

Q −rc +∑ni=1 wiCji rc

0T 1

)

where Q stands for the interpolation of pure rotations, computed asindicated in section 4.2. Using T−1v = v− rc and T x = x+ rc, wesee that

v′ = T q(W ;T−1Cj1 T, . . . ,T−1Cjn T )T−1v

= T

(Q −rc +∑n

i=1 wiCji rc0T 1

)(v− rc

1

)

= Q(v− rc)+n

∑i=1

wiCji rc

is true for any vector v. This is exactly the equation (9).

References

ALEXA, M. 2002. Linear combination of transformations. InSIGGRAPH ’02: Proceedings of the 29th annual conferenceon Computer graphics and interactive techniques, ACM Press,380–387.

ANDERSON, E., BAI, Z., BISCHOF, C., BLACKFORD, S., DEM-MEL, J., DONGARRA, J., DU CROZ, J., GREENBAUM, A.,HAMMARLING, S., MCKENNEY, A., AND SORENSEN, D.1999. LAPACK Users’ Guide, third ed. Society for Industrialand Applied Mathematics, Philadelphia, PA.

BLOOMENTHAL, J. 2002. Medial-based vertex deformation. InProceedings of the 2002 ACM SIGGRAPH/Eurographics sym-posium on Computer animation, ACM Press, 147–151.

BUSS, S. R., AND FILLMORE, J. P. 2001. Spherical averages andapplications to spherical splines and interpolation. ACM Trans.Graph. 20, 2, 95–126.

EBERLY, D. 2001. 3D game engine design: a practical approachto real-time computer graphics. Morgan Kaufmann PublishersInc.

KAVAN, L., AND ZARA, J. 2003. Real-time skin deformation withbones blending. In WSCG Short Papers Proceedings.

KRY, P. G., JAMES, D. L., AND PAI, D. K. 2002. Eigenskin:real time large deformation character skinning in hardware. InProceedings of the 2002 ACM SIGGRAPH/Eurographics sym-posium on Computer animation, ACM Press, 153–159.

LANDER, J. 1998. Skin them bones: Game programming for theweb generation. Game Developer Magazine (May), 11–16.

LANDER, J. 1999. Over my dead, polygonal body. Game Devel-oper Magazine (October), 17–22.

LEWIS, J. P., CORDNER, M., AND FONG, N. 2000. Posespace deformation: a unified approach to shape interpolationand skeleton-driven deformation. In Proceedings of the 27thannual conference on Computer graphics and interactive tech-niques, ACM Press/Addison-Wesley Publishing Co., 165–172.

MAGNENAT-THALMANN, N., LAPERRIERE, R., AND THAL-MANN, D. 1988. Joint-dependent local deformations for handanimation and object grasping. In Proceedings on Graphics in-terface ’88, Canadian Information Processing Society, 26–33.

MAGNENAT-THALMANN, N., CORDIER, F., SEO, H., AND PA-PAGIANAKIS, G. 2004. Modeling of bodies and clothes forvirtual environments. In CW ’04: Proceedings of the 2004 Inter-national Conference on Cyberworlds (CW’04), IEEE ComputerSociety, 201–208.

MOHR, A., AND GLEICHER, M. 2003. Building efficient, accuratecharacter skins from examples. ACM Trans. Graph. 22, 3, 562–568.

MOHR, A., TOKHEIM, L., AND GLEICHER, M. 2003. Directmanipulation of interactive character skins. In Proceedings ofthe 2003 symposium on Interactive 3D graphics, ACM Press,27–30.

PARK, S. I., SHIN, H. J., AND SHIN, S. Y. 2002. On-line locomo-tion generation based on motion blending. In Proceedings of the2002 ACM SIGGRAPH/Eurographics symposium on Computeranimation, ACM Press, 105–111.

SHOEMAKE, K. 1985. Animating rotation with quaternion curves.In Proceedings of the 12th annual conference on Computergraphics and interactive techniques, ACM Press, 245–254.

SLOAN, P.-P. J., ROSE, III, C. F., AND COHEN, M. F. 2001.Shape by example. In Proceedings of the 2001 symposium onInteractive 3D graphics, ACM Press, 135–143.

STEED, P. 2002. Animating Real-Time Game Characters withCDROM. Charles River Media, Inc.

WANG, X. C., AND PHILLIPS, C. 2002. Multi-weight enveloping:least-squares approximation techniques for skin animation. InProceedings of the 2002 ACM SIGGRAPH/Eurographics sym-posium on Computer animation, ACM Press, 129–138.

WEBER, J. 2000. Run-time skin deformation. In Proceedings ofGame Developers Conference.