9
Interactive Deformation Using Modal Analysis with Constraints Kris K. Hauser Chen Shen James F. O’Brien EECS, Computer Science Division University of California, Berkeley Abstract Modal analysis provides a powerful tool for efficiently simulating the behavior of deformable objects. This paper shows how manipulation, collision, and other constraints may be implemented easily within a modal framework. Results are presented for several example simulations. These results demonstrate that for many ap- plications the errors introduced by linearization are ac- ceptable, and that the resulting simulations are fast and stable even for complex objects and stiff materials. Key words: Animation techniques, physically based mod- eling, simulation, dynamics, deformation, modal analy- sis, modal synthesis, finite element method, video games, interactive simulation, real-time simulation, constraints, precomputed dynamics. 1 Introduction Interactive modeling of deformable objects has a wide range of applications from surgical training to video games. Many of these applications require realistic, real-time simulation for complex objects. Unfortunately, the most straightforward simulation methods turn out to be prohibitively expensive for modeling objects of even modest complexity. When the high cost of simulation couples with the reality that CPU cycles must be shared among many tasks, the need for faster, more sophisticated simulation methods becomes clear. Recently several ingenious techniques for modeling deformable objects have been proposed. Examples in- clude multi-resolution representations that avoid wasting time on irrelevant details (e.g. [4, 6, 8]), reformulating the dynamics to make them more stable (e.g. [15,20]), exten- sive precomputation to minimize runtime costs (e.g. [9, 10, 19, 22]), robust integration schemes that afford large time-steps (e.g. [3]), and many other approaches that we cannot list here due to space constraints. As of yet, none provides a perfect solution that satisfies the requirements for all interactive applications. This paper reexamines a technique known as modal analysis that was originally introduced to the graph- ics community over a decade ago, but has since been largely neglected, with only a couple of notable excep- Figure 1: This example demonstrates a complex model being deformed using a modal simulation method. The object furthest from the viewer shows the undeformed configuration. The nearer objects are being deformed by a force indicated by the blue arrows. tions (e.g. [10, 22, 23]). Like the techniques mentioned above, modal analysis does not provide a perfect solution for every interactive application, but it does provide a so- lution that suits some applications quite well. The results presented here show that modal analysis can be used effectively to model situations where the de- formable object is directly manipulated using constraints and where it interacts with an environment through con- tact forces. We demonstrate that although linear modal analysis does incur errors because of the inherent lin- earization of the dynamics, these errors are acceptable in many contexts, particularly when exaggerated cartoon- like deformations are desired. While precomputing the modal decomposition for a complex object may take up to a few hours of precomputation, for applications which make use of fixed content this computational cost only occurs during content development and it is well worth the dramatic increase in runtime performance. The concepts required to manipulate the modal equa- tions are to a certain extent conceptually difficult to work with but their implementation is surprisingly simple. The results shown in this paper (e.g. figure 1) were gener-

Interactive Deformation Using Modal Analysis with Constraints...sis, modal synthesis, finite element method, video games, interactive simulation, real-time simulation, constraints,

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Interactive Deformation Using Modal Analysis with Constraints...sis, modal synthesis, finite element method, video games, interactive simulation, real-time simulation, constraints,

Interactive Deformation Using Modal Analysis with Constraints

Kris K. Hauser Chen Shen James F. O’Brien

EECS, Computer Science DivisionUniversity of California, Berkeley

AbstractModal analysis provides a powerful tool for efficiently

simulating the behavior of deformable objects. Thispaper shows how manipulation, collision, and otherconstraints may be implemented easily within a modalframework. Results are presented for several examplesimulations. These results demonstrate that for many ap-plications the errors introduced by linearization are ac-ceptable, and that the resulting simulations are fast andstable even for complex objects and stiff materials.

Key words: Animation techniques, physically based mod-eling, simulation, dynamics, deformation, modal analy-sis, modal synthesis, finite element method, video games,interactive simulation, real-time simulation, constraints,precomputed dynamics.

1 Introduction

Interactive modeling of deformable objects has a widerange of applications from surgical training to videogames. Many of these applications require realistic,real-time simulation for complex objects. Unfortunately,the most straightforward simulation methods turn out tobe prohibitively expensive for modeling objects of evenmodest complexity. When the high cost of simulationcouples with the reality that CPU cycles must be sharedamong many tasks, the need for faster, more sophisticatedsimulation methods becomes clear.

Recently several ingenious techniques for modelingdeformable objects have been proposed. Examples in-clude multi-resolution representations that avoid wastingtime on irrelevant details (e.g.[4,6,8]), reformulating thedynamics to make them more stable (e.g.[15,20]), exten-sive precomputation to minimize runtime costs (e.g. [9,10, 19, 22]), robust integration schemes that afford largetime-steps (e.g.[3]), and many other approaches that wecannot list here due to space constraints. As of yet, noneprovides a perfect solution that satisfies the requirementsfor all interactive applications.

This paper reexamines a technique known as modalanalysis that was originally introduced to the graph-ics community over a decade ago, but has since beenlargely neglected, with only a couple of notable excep-

Figure 1: This example demonstrates a complex modelbeing deformed using a modal simulation method. Theobject furthest from the viewer shows the undeformedconfiguration. The nearer objects are being deformed bya force indicated by the blue arrows.

tions (e.g. [10, 22, 23]). Like the techniques mentionedabove, modal analysis does not provide a perfect solutionfor every interactive application, but it does provide a so-lution that suits some applications quite well.

The results presented here show that modal analysiscan be used effectively to model situations where the de-formable object is directly manipulated using constraintsand where it interacts with an environment through con-tact forces. We demonstrate that although linear modalanalysis does incur errors because of the inherent lin-earization of the dynamics, these errors are acceptablein many contexts, particularly when exaggerated cartoon-like deformations are desired. While precomputing themodal decomposition for a complex object may take upto a few hours of precomputation, for applications whichmake use of fixed content this computational cost onlyoccurs during content development and it is well worththe dramatic increase in runtime performance.

The concepts required to manipulate the modal equa-tions are to a certain extent conceptually difficult to workwith but their implementation is surprisingly simple. Theresults shown in this paper (e.g. figure 1) were gener-

Page 2: Interactive Deformation Using Modal Analysis with Constraints...sis, modal synthesis, finite element method, video games, interactive simulation, real-time simulation, constraints,

ated using an implementation that we have ported to sev-eral platforms: SGI IRIX, Windows, Linux, and SonyPlayStation2. On each of these platforms we were ableto obtain interactive simulation times even for relativelycomplex models.

2 Background

Modal analysis is a well established mathematical tech-nique that has been used extensively in mechanical,aerospace, civil, and other engineering disciplines forseveral decades. To a large extent the work we presentin this paper follows as direct application of the methodsdeveloped in those fields to the task of interactively simu-lating deformable solids. There are, however, some issuesthat are unique to interactive simulation, such as impos-ing manipulation constraints and computing fast collisionresponses. This paper focuses on those issues. A discus-sion of modal analysis and its use with the finite elementmethod can be found in the text by Cook, Malkus, andPlesha [5], and a more detailed discussion of modal anal-ysis, its mathematical theory, and its applications may befound in the text by Maia and Silva [13].

Modal analysis was first introduced to the graphicscommunity in 1989 by Pentland and Williams as a fastmethod for approximating deformation [19]. They useda hybrid framework, previously described by Terzopou-los and Fleischer [24], that separated the motion of adeformable solid into a rigid component and a deforma-tion component. The deformable component existed ina non-inertial reference frame that moved with the rigidcomponent. To avoid the cost of computing the modesfor a particular object Pentland and Williams used linearand quadratic deformation fields defined over a rectilin-ear volume instead of the object’s actual modes and thenembedded the object within the region in a fashion simi-lar to a free-form deformation. Although using approxi-mated modes is computationally inexpensive, it only gen-erates reasonable results for compact objects that are wellapproximated by a rectilinear solid. Pentland and hiscolleagues also integrated their modal deformation tech-niques into a interactive modeling system [18].

In 1997 Stam developed a modal method for model-ing trees blowing in the wind [23]. Rather than startingwith a deformable object, he computed the low-frequencymodes from an articulated structure that described thetree. Once the closed-form solutions for each mode werecomputed, the response of the tree to a stochastic windfield could be computed efficiently.

Most recently, James and Pai implemented a system forcomputing real-time modal deformations on commoditygraphics hardware [10]. They focused on modeling de-formable skin and soft tissues attached to moving charac-

ters or as background elements in a surgical simulation.Shen and his colleagues have demonstrated an interac-tive system that could simulate models with over 10,000vertices on a laptop PC with no special hardware acceler-ation [22].

Other related work includes sound generation tech-niques that make use of modal synthesis, and deforma-tion techniques that use global shape functions that havesome general similarities to a object’s mode shapes. Vanden Doel and his colleagues have used both analyticallycomputed modes for simple geometric shapes and sam-pled modes from real objects to compute realistic soundsfor simulated environments [26, 27, 28]. O’Brien andhis colleagues developed similar techniques that used nu-merically computed modes from a finite element descrip-tion of an object [17]. Examples of deformation tech-niques using global shape functions include: free-formdeformations and their dynamics extensions [7, 21], de-formable superquadrics [14], and the boundary elementmethod [9]. Modal bases have also proven to be an ef-ficient way to compactly encode both shapes and defor-mations [11, 12]. Finally, this paper focuses primarilyon integrating manipulation and contact constraints intoa modal framework, and there is prior work on applyingthese types of constraints to flexible body simulations [2].

3 Methods

The mechanical properties of an object can generally becaptured by a function that maps the state of the object toa distribution of internal forces. For nearly any non-trivialsystem this function will be nonlinear and the represen-tation of state will require many variables. Consequently,modeling the object’s behavior over time will involve in-tegrating a large, nonlinear system of differential equa-tions. These systems are typically far too complex to besolved analytically, so some type of numerical solutionmethod must be employed.

Modal analysis is the process of taking the nonlineardescription of a system, finding a good linear approxima-tion, and then finding a coordinate system that diagonal-izes the linear approximation. This process transforms acomplicated system of nonlinear equations into a simpleset of decoupled linear equations that may be individuallysolved analytically.

The main benefit of this modal approach is that the be-havior of the system can be computed much more effi-ciently. Because each of the decoupled equations can besolved analytically, the stability limitations that plaguenumerical integration methods are eliminated. Further,one may examine each of the decoupled components anddiscard those that are irrelevant to the problem at hand.

Page 3: Interactive Deformation Using Modal Analysis with Constraints...sis, modal synthesis, finite element method, video games, interactive simulation, real-time simulation, constraints,

Figure 2: Using a linear formulation to model a bend-ing bar produces acceptable results for small to moderateamounts of deformation. For larger deformations signif-icant amounts of distortion appear. This example showsthe deformation corresponding to the bar’s second trans-verse mode.

There are also two drawbacks to a modal approach.First, linearizing the original nonlinear equations meansthat the solution will only be a first order approximationof the true solution. How objectionable the lineariza-tion error is depends on the application and the extentto which the objects deform from their initial configura-tions. As illustrated by figure2, small to moderate defor-mations exhibit little or no noticeable error when casuallyobserved. Even when the errors do grow noticeable, theyhave a cartoon-like, exaggerated appearance that may ac-tually be desirable for some applications.

The second drawback arises because decoupling thelinear system requires computing its eigendecomposition.However we do not believe that this drawback is partic-ularly significant. The content in most interactive appli-cations is constant, so that eigendecompositions can beprecomputed during content development and stored withthe objects. Furthermore, the linear systems are sparse,so that fast, robust, publicly available codes may be usedto efficiently compute the decompositions (e.g.TRLAN[29]).

The remainder of this section describes how one com-putes the modal decomposition for a given object andhow that decomposition can be used to efficiently modelthe object’s behavior. Some of this material has been pre-sented elsewhere by others in the graphics community(e.g. [10, 19]) but we include it here for completeness.The discussion will focus in particular on including ma-nipulation and collision constraints in the modal frame-work. An overview of the entire process is shown in fig-ure3.

3.1 Modal DecompositionThe modal decomposition of a physical system beginswith a linear set of equations that describe the system’sbehavior. In general, the equations describing the system

Generatetetrahedral mesh

Buildsystem matrices

Computeeigen-decomposition

Object geometryand material properties

Computerigid-body parameters

and buildcollision structures

Preprocessing

Interactive

Deformable Object Motion

Rigid-bodysimulationModal synthesis

Contact/InertialForces

CollisionGeometry

User InteractionConstraints

Figure 3: This diagram illustrates both the preprocessingsteps used to construct the deformable modal model foran object, and the processes that subsequently generateinteractive motion from this description.

may be nonlinear, and one obtains the linear equations bylinearizing about some point, typically the rest configu-ration of the system. The linearized equations have thegeneral form:

Kd + Cd + Md = f , (1)

whereK, C, andM are respectively known as the sys-tem’s stiffness, damping, and mass matrices,d andf re-spectively as the vector of generalized displacements andforces, and an overdot indicates differentiation with re-spect to time. The physical meaning of the generalizedforce and displacement vectors, and the method for com-puting the system matrices will depend on the type ofmethod used for modeling the system. For general fi-nite element methods, we refer the reader to the excellenttext by Cook, Malkus, and Plesha [5]. We are using animplementation of the piecewise-linear tetrahedral finiteelement method described by O’Brien and Hodgins [16].Details on computing the system matrices appear in [17].

Modal decomposition refers to the process of diago-nalizing equation (1). The most general form of modaldecomposition can be used for nearly arbitrary systems,but the systems arising from the finite element methodwe use have a structure that makes them amenable to asimpler manipulation provided we assume that the damp-ing matrix,C, is a linear combination of theK andM .This restriction is known as Rayleigh damping, and al-though it is a restriction it still produces results superior tothe simple mass damping that is most commonly used in

Page 4: Interactive Deformation Using Modal Analysis with Constraints...sis, modal synthesis, finite element method, video games, interactive simulation, real-time simulation, constraints,

graphics applications. With these conditions, diagonaliz-ing equation (1) becomes equivalent to solving a general-ized symmetric eigenproblem with symmetric, positive-definite matrices. Cook, Malkus, and Plesha describe theprocess in detail and we only repeat the end result here.

With the restriction of Rayleigh damping equation (1)may be rewritten as:

K(d + α1d) + M(α2d + d) = f , (2)

whereα1 andα2 are the Rayleigh coefficients. Let thecolumns ofW be the solution to the generalized sym-metric eigenproblemKx + λMx = 0 andΛ be thediagonal matrix of eigenvalues1, then equation (2) maybe transformed to:

Λ(z + α1z) + (α2z + z) = g , (3)

wherez = W−1d is the vector of modal coordinatesandg = W Tf is the external force vector in the modalcoordinate system.

Each row of equation (3) corresponds to a single scalarsecond-order differential equation:

λizi + (α1λi + α2)zi + zi = gi . (4)

The analytical solutions to each equation are

zi = c1etω+

i + c2etω−

i (5)

wherec1 andc2 are arbitrary (complex) constants, andωiis the complex frequency given by

ω±i =−(α1λi + α2)±

√(α1λi + α2)2 − 4λi2

. (6)

The absolute value of the imaginary part ofωi is the fre-quency (in radians/second, not Hertz) of the mode, andthe real part is the mode’s decay rate. In the special casewhere the term under the radical in equation (6) is zero,we haveω+

i = ω−i , which gives the critically dampedsolution:

zi = c1tetωi + c2e

tωi . (7)

The columns ofW are the vibrational modes of theobject being modeled. (See figure4.) Each mode has theproperty that a displacement or velocity over the objectthat is a scalar multiple of the mode will produce an ac-celeration that is also a scalar multiple of the mode. Thisproperty means that the modes do not interact with eachother, which is why decoupling the system into a set ofindependent oscillators was possible. The eigenvalue foreach mode is the ratio of the mode’s elastic stiffness to themode’s mass, and it is the square of the mode’s naturalfrequency (in radians per second). In general the eigen-values will be positive, but for each free body in the sys-tem there will be six zero eigenvalues that correspond to

1 Equivalently letW = L−TV whereM = LLT (Choleskydecomposition) andV ΛV T = L−1KL−T (symmetric eigendecom-position).

Figure 4: The two rows show a side and top view ofa bowl along with three of the bowl’s first vibrationalmodes. The modes selected for the illustration are thefirst three non-rigid modes with distinct eigenvalues thatare excited by a transverse impulse to the bowl’s rim.

the body’s six rigid-body modes. The rigid-body eigen-values are zero because a rigid-body displacement willnot generate any elastic forces.

The decoupled system of equations isnot an approxi-mationof the original linear system, it will generate ex-actly the same results as the original linear system. Ofcourse the linear system may have been an approxima-tion to some initial nonlinear one, but any problem thatcould be solved using equation (2) could also be solvedwith equation (3). Furthermore, simulation that wouldhave required numerical time integration of equation (1)can now be solved without integration using the analyti-cal solutions in equations (5) or (7).

3.2 Discarding ModesAlthough decoupling equation (1) and then solving eachof the resulting components analytically provides signifi-cant benefits, we can derive additional benefit by consid-ering whether or not each of these components is needed.In particular we can discard modes that will have no sig-nificant effect on the phenomena we wish to model.

If the eigenvalue,λi, associated with a particular modeis large, then the force required to cause a discernibledisplacement of that mode will also be large. We canexpect that in a given environment there will be bothan upper bound on the magnitude of the forces encoun-tered and a lower limit on the amplitude of observablemovement. For example, if modeling an indoor envi-ronment we would not expect to encounter forces in ex-cess of60, 000 N (the braking force of a large truck), andwe would not be able to observe displacements less thanabout0.1 mm. Thus if ||wi||2/λi < min res/max frcfor some mode then that mode’s behavior will be unob-servable.

The imaginary part ofωi determines the frequency thata mode will vibrate at. Modes that vibrate at more thanhalf the display’s frame rate will cause temporal aliasing.

Removing modes that are too stiff and/or too high fre-quency to be observed will not change the appearance of

Page 5: Interactive Deformation Using Modal Analysis with Constraints...sis, modal synthesis, finite element method, video games, interactive simulation, real-time simulation, constraints,

the resulting simulation, but removing them will greatlyreduce the simulation’s cost. For most objects that wehave worked with, nearly all of the modes are unobserv-able. A typical result is that an object with several thou-sand vertices will have many fewer than fifty modes thatneed to be retained. Furthermore, the number of modesthat must be retained is nearly independent from the res-olution of the model.

For later convenience letW be the matrixW withthe columnscorresponding to the discarded modes re-moved, and letW

−1be the matrixW−1 with the rows

corresponding to the discarded modes removed. NotethatW

−1 6= (W )−1, W andW−1

are not square, andW

−1W = I butWW

−1 6= I.

3.3 Oscillator Coefficients and Time StepsThe analytical solution for each mode, equation (5), de-scribes how that mode will behave when no externalforces are acting on it. Using these solutions, however, re-quires some way of modeling responses to external forcesand of setting initial conditions.

Given a set of initial conditions described by the nodepositions,d0, and their velocities,d0, setting the oscil-lators to match those conditions requires finding appro-priate values for the coefficientsc1 and c2. First, theinitial conditions are transformed to modal coordinates:z0 = W

−1d0 and z0 = W

−1d0. For each mode,c1

andc2 are given by

c1 =z02

+(α1λi + α2)z0 + 2z0

2√

(α1λi + α2)2 − 4λi(8)

c2 =z02− (α1λi + α2)z0 + 2z0

2√

(α1λi + α2)2 − 4λi. (9)

For the critically damped casec1 andc2 are given by

c1 =(α1λi + α2)z0

2+ z0 (10)

c2 = z0 . (11)

Note that if theω±i are real thenc1 andc2 will also bereal. If theω±i are complex then theω±i and thec1 andc2 will be complex conjugate pairs. In either case equa-tion (6) will evaluate to a real value.

To compute the response of a mode to an impulse de-livered at t = 0, first transform the impulse to modalcoordinates with∆tg = ∆tW T

f and then computec1andc2 as shown above withz0 set to zero andz0 replacedby ∆tg. Because the modes behave linearly, the responseof the system to forces applied at an arbitrary time maybe computed by time-shifting this impulse response andadding it to the existing values.

Becausece(t+∆t)ω = (cetω)e∆tω, the state of eachoscillator can be stored simply as a pair of complex num-bers that reflect the current values ofc1e

tω+andc2etω

−.

Each time the system is advanced forward in time, thesevalues get multiplied bye∆tω

±. If ∆t is constant then

the step multiplier for each mode may be cached to avoidthe cost of evaluating an exponential. Impulses appliedto the system simply require adding the appropriate val-ues to each oscillator’s state. Finally, modes whereω+

andω− are complex conjugate pairs (i.e. underdampedmodes) can be reduced to only a single oscillator.

3.4 ConstraintsAlthough we can compute the behavior of the decom-posed system extremely efficiently, the method is notparticularly useful unless it accommodates manipulationconstraints and collision response. When working withthe original system constraints on the node positions arenearly trivial to implement. Collision response requiresmore sophistication but still is conceptually straightfor-ward. Unfortunately, applying these same constraints inthe modal basis requires moving between the node po-sitions and modal coordinates which can be unintuitive.Matters are further complicated because if we have dis-carded any modes then the transformations will be non-invertible.

3.4.1 Interactive ManipulationIf we wish to include continual constraints on part of thesystem, the optimal way to do so is to remove those de-grees of freedom prior to performing the modal decom-position. Examples demonstrating this approach can beseen in James and Pai’s modal method for modeling tis-sue deformation [10], and in our deformable sheet ex-ample. (See accompanying animations.) Using this ap-proach for dynamic constraints, however, would requirerecomputing the eigendecomposition each time a con-straint was added or removed from the system. Jamesand Pai accomplished something similar for a boundaryelement method using Sherman-Morrison-Woodbury up-dates but we do not know of any corresponding incremen-tal update scheme for an eigensystem [9].

Instead we apply manipulation constraints to the de-composed system. Letψ be the set of degrees of freedomin the original system that we wish to constrain, and letφ be the places where we are willing to apply forces inorder to enforce the constraints. For a manipulation taskwhere a point on the object is being dragged we wouldtypically haveφ = ψ but we will not require it. Letdψor fφ denote the displacement or force vectors where allexcept the elements corresponding toφ or ψ have beenremoved. Similarly, letW ψ be W where all the rows

not inψ have been removed and letWTφ beW

Twhere

all the columns but for those inφ have been removed. Fi-nally, let d

∗ψ be the desired accelerations at the constraint

locations. By combiningd = W z, g = WTf and a bit

Page 6: Interactive Deformation Using Modal Analysis with Constraints...sis, modal synthesis, finite element method, video games, interactive simulation, real-time simulation, constraints,

of manipulation we obtain:

d∗ψ = W ψ(z + W

Tφfφ) . (12)

Solving forfφ yields:

fφ =(W ψW

)−P (d∗ψ − W ψz

), (13)

where·−P denotes a pseudoinverse. Velocity constraintsonly differ in thatfφ gets replaced by an impulse,e.g.∆tfφ and we have:

fφ =1

∆t

(W ψW

)−P (d∗ψ − W ψz

). (14)

Position constraints can be enforced in a similar fashionso long as we adjust for how each mode will evolve overthe interval while the force is applied:

fφ =2

∆t2(W ψSW

)−P (d∗ψ − W ψz

), (15)

whereS the diagonal matrix with components given by

sii =e∆tω

+i − e∆tω

−i

|√

(α1λi + α2)2 − 4λi|(16)

that compensates for the motion of each mode during theinterval.

3.4.2 Dynamics SimulationImplementing a deformable dynamics simulator for freebodies using modal analysis can be accomplished bycombining the modal simulation with a standard rigid-body dynamics simulator. The modal system is embed-ded in a rigid-body reference frame, and both systemsevolve over time. The two systems interact with eachother though inertial effects. The modal system shouldexperience centrifugal and coriolis forces as the rigid-body moves, and the inertial moments of the rigid-bodywill change as the modal system deforms. Unless the ob-ject is rotating rapidly, neither effect will be significantso we omit them. They could be included at an additionalcomputational cost. Inertial effects due to translationaland rotational acceleration of the rigid-body frame do notneed to be modeled explicitly so long as the forces gen-erating those accelerations are also applied to the modalsystem.

Because we are modeling deformable objects, a colli-sion detection method optimized for use with rigid-bodysimulations requires some modification because precom-puted data structures will become invalid as the objectdeforms. The method we are using employs a hierar-chy of axis-aligned bounding boxes, aligned to the worldaxes, to efficiently find potential collisions. The tree isinitially constructed based on the undeformed shape ofthe object. Each leaf node in the tree corresponds to oneof the primitives that makes up the object, and the bound-ing box at that node encloses the primitive. The bounding

boxes of interior nodes encompass the union of their chil-dren. The tree’s topology is chosen to minimize the over-lap among the interior nodes. Once the object deformsthe tree will become invalid, but recomputing the tree’stopology every time-step would be prohibitively expen-sive. Instead we use an update scheme similar to onedescribed by van den Bergen [25]. After each time-stepthe bounding boxes are updated, but the tree’s topologydoes not change. If we expected arbitrary deformation,this could result in a very poorly structured tree, but be-cause the extent of deformation is limited we have foundthis approach to work quite well.

Using these trees the collision system can efficientlydetermine contact points and a normal for each contact.For collisions between an object and a ground plane, thecollision normal is simply the plane’s normal. For colli-sions between objects, we look at involved tetrahedra todetermine a normal based on their overlap [16]. We havefound that each physical contact site may produce severalpairs of colliding primitives. To reduce the computationwhen using constraint-based collisions we cluster nearbycollision points and treat each cluster as a single collisionpoint.

We have implemented collision response using botha penalty-based method and using constraints. Asone would expect, the penalty methods require lesswork per time-step, achieving real-time performance, butstiff penalty coefficients can lead to instability. Theconstraint-based method requires more work per time-step, but it is more stable. Because the modal system willallow arbitrarily large time-steps in the absence of exter-nal influences we prefer the more stable constraint-basedmethods.

To implement penalty methods, when a point on a sur-face violates one of the penalty constraints, a force pro-portional to the magnitude of the violation is applied atthat point. Transforming the forces to modal coordinatesand then applying the force to the modal system is doneas described previously. The penalty force should be ap-plied to both the modal and the rigid-body systems.

Constraint-based collisions require a more compleximplementation, but we find that they produce better re-sults. First, when a collision occurs, the simulation isbacked up to the point during the time-step when the ob-jects first came into contact. Then contact forces are cal-culated as the minimal outward normal force to ensurethat the objects will not continue to penetrate. These aredetermined by solving a linear programming problem forthe normal forces at all contact points. Baraff details anefficient method for solving for the required forces [1].

Constraint methods are often used in traditional rigid-body simulations only to solve for resting contact, while

Page 7: Interactive Deformation Using Modal Analysis with Constraints...sis, modal synthesis, finite element method, video games, interactive simulation, real-time simulation, constraints,

impulses are used to calculate elastic response. Elasticcomponents of the response can be handled differently inour modal simulation, because the elastic behavior of themodal system models them directly. We first enforce avelocity constraint that solves for an impulse to ensurethat none of the contact velocities are negative, then sec-ondly it enforces an acceleration constraint that solves fora force to ensure that none of the contact accelerationsare negative. The derivation of these methods requiresequations relating the change in velocity and accelerationwith respect to an applied impulse and acceleration, re-spectively.

Let pl be the location of a contact point on an objectexpressed in the local coordinate frame of the rigid body.This location will be a linear function of the modal coor-dinates so that:

pl = UWz , (17)whereU is a matrix that averages the appropriate nodelocations based on the barycentric location ofp in one ofthe surface triangles. The location in world coordinatesis given by

pw = t + Rpl , (18)wheret andR are the translation and rotation matricesfor the rigid-body frame. Differentiating with respect totime to obtain the world velocity and acceleration ofpyields:

pw = t + R[ω]pl + Rpl , (19)pw = t+R[ω][ω]pl+R[α]pl+2R[ω]pl+Rpl , (20)

where ω and α are the rigid-body’s angular velocityand acceleration2. The notation[a] denotes the skew-symmetric matrix such that[a]b = a× b = −[b]a.

Differentiating equation (19) with respect to an appliedimpulse allows us to obtain the change in velocity gener-ated by a constraint force over a time interval:

∆pw = ∆t(

1m

fw + R[H−1τ l]pl + RUWWTf l

)(21)

whereH is the object’s inertia matrix andτ is the torquegenerated byf . Differentiating equation (20) with re-spect to an applied force produces a similar result for thechange in acceleration at the contact point. These equa-tions are linear inf , and can be used similarly to solvefor position, joint, and collision constraints. Position con-straints require that a point’s velocity and acceleration arezero. Joint constraints require relative velocities and ac-celerations are zero, merely requiring a subtraction of theproper terms. Collision constraints require the normalcomponents of relative velocities and accelerations arenonnegative, and only solve for the nonnegative normal

2In order to adhere to common convention we are reusingω andα, that were previously used for the modal frequencies and Rayleighdamping coefficients. The intended meaning should be clear from con-text and the presence/absence of bold notation.

Example Fig Verts. Nodes Tets. Modes Time

Brain 1 18,847 304 997 40 68.5sec

Dodo 5 336 113 295 40 6.2sec

Bunny 8 2,633 37,114 15,507 32 24min

Sphere video 66 80 282 40 2.9sec

Sheet video 195 195 486 20 14.4sec

Bat video 241 310 1,030 20 68.9sec

Table 1: This table list the number of vertices in therendered models, the number of nodes and elements inthe finite element models, the number of modes retained,and the time required to compute the decomposition forsome of the demonstration objects.

force magnitude. All constraints are solved simultane-ously as a linear program. Solving cannot always be donein real-time if there are a large number of contact points,although system response does remain interactive.

We model friction at the contacts using a simplifiedCoulomb friction model. The system computes a forceopposite the tangential velocity at the contact points. Themagnitude of the force equals the magnitude of the nor-mal force multiplied by a friction coefficient. If the fric-tion force causes the predicted tangential velocity to bereversed then it is limited to the force that would causeno slipping. If interactivity can be sacrificed, a more pre-cise method would be to add an additional no-slip con-straint to be re-solved with the other constraints. We findour heuristic reasonable for producing plausible frictioneffects.

4 Results

We have implemented a system that models deformableobjects using a hybrid formulation that combines rigid-body motion with deformation computed using modalanalysis. Objects may be interactively manipulated bythe user with both penalty forces and displacement con-straints. The modal objects may collide with each otherand with their environment. Collisions can be treatedwith either penalty forces or constraints, and objects mayalso be attached together using joint constraints. Table1lists several of the models we have used to demonstrateour results and shows the geometric and kinematic com-plexity of the models along with how much precomputa-tion time was required to perform the modal decomposi-tion for each model.

The brain model in figure1 demonstrates pulling andpushing using force application. Force vectors are pro-jected into the modal basis, modifying the modal state,and then are projected out, resulting in realistic deforma-tion. The images in figure6 and figure7 show pulling andpushing using manipulation constraints. Typically, up to

Page 8: Interactive Deformation Using Modal Analysis with Constraints...sis, modal synthesis, finite element method, video games, interactive simulation, real-time simulation, constraints,

Figure 5: This image sequence shows frames from an animation of a pair of objects colliding with each other. Eachobject is a hybrid simulation that incorporates a rigid and a deformable (modal) component.

Figure 6: These images shows how constraints can beused to deform objects. The object on the left of each im-age shows the object prior to deformation, and the rightobject shows the results after the red constraint pointshave been moved.

Figure 7: These images are screen shots from an applica-tion running natively on a Sony PlayStation2. The yellowcircle highlights the cursor that the user is using to pokeand pull an elastic figure.

around 10 points on the model can be constrained in real-time on a moderate speed computer (300 MHz PentiumII or Sony Playstation2). A limit is reached because thesolutions to equation (13) and equation (15) require a rel-atively expensive computation of singular value decom-positions, which cannot be calculated in real-time oncethe matrices become too large.

We have created several animations (see supplementalmaterials) demonstrating this system, each simulated in-teractively for moderately complex objects. The resultsappear plausible, and resemble animations that might besimulated using more straightforward but more compu-tationally expensive methods. The bottlenecks in hybridmodal/rigid-body simulation are collision detection andsolving the linear program for the constraints. To reducethe computation used in solving the linear program, theextent of contact point clustering may be tweaked to sac-rifice accuracy for speed. Figures5 and8 show objectsinvolved in collisions with a ground plane and each other.

Figure 8: A sequence of images showing the StanfordBunny model bouncing off a ground plane.

As with other methods based on tetrahedral finite el-ements, we can embed high-resolution or non-manifoldsurfaces inside a tetrahedral volume model. The bene-fits of this technique are that the surface shading and tex-turing can be specified independently from the dynam-ics, and poorly constructed “polygon-soup” models maybe used. Both the brain model in figure1, an extremelycomplex object, and the “dodo” model in figure5, a non-manifold object, are modeled in this way. The “dodo”model also demonstrates non-uniform material proper-ties: the legs and beak are made of a stiffer material thanthe rest of the body.

5 Conclusions

Modal analysis has been shown to be a useful tool for in-teractively producing realistic simulations of elastic de-formation. Both the analytic calculation of modal ampli-tudes using complex oscillators and the removal of high-frequency modes have a stabilizing effect on simulations,allowing for large time steps to be taken.

Despite the approximation of linearity in modal anal-ysis, the simulation results are quite plausible for mostobjects. The exceptions are long, thin, or highly de-formable objects, where nonlinear behavior dominatesthe expected behavior. Despite these specific drawbacks,many objects can be manipulated quite efficiently and re-alistically using modal models.

The already small costs of modal analysis can be re-duced further by leveraging graphics hardware, as shownby James and Pai [10] or our own implementation on theSony PlayStation2. Using such hardware, CPU costs canbe reduced to modifying mode amplitudes during evolu-tion of time steps, projection of forces, and application ofmanipulation constraints.

Page 9: Interactive Deformation Using Modal Analysis with Constraints...sis, modal synthesis, finite element method, video games, interactive simulation, real-time simulation, constraints,

We recognize that there are many implementation de-tails that cannot fit into this paper, so we have re-leased the source code for our Linux implementationunder the GNU License. It is our hope that makingthis code available will encourage others to work withmodal simulation methods. The code may be accessed atwww.cs.berkeley.edu/∼job/Projects/ModeDef.

Acknowledgments

The authors thank Christine Gatchalian for her help withthe models used in the example, the other members ofthe Berkeley Graphics Group for their support, and thereviewers for their insightful comments.

This work was supported with contributions from SonyComputer Entertainment America, Intel Corporation, andPixar Animation Studios, and with NFS grant CCR-0204377 and State of California MICRO grant 02–055.

References[1] David Baraff. Fast contact force computation for nonpen-

etrating rigid bodies. InProceedings of SIGGRAPH 94,pages 23–34, July 1994.

[2] David Baraff and Andrew P. Witkin. Dynamics simula-tion of non-penetrating flexible bodies. InProceedings ofSIGGRAPH 92, pages 303–308, July 1992.

[3] David Baraff and Andrew P. Witkin. Large steps in clothsimulation. InProceedings of SIGGRAPH 98, pages 43–54, July 1998.

[4] Steve Capell, Seth Green, Brian Curless, Tom Duchamp,and Zoran Popovic. Interactive skeleton-driven dynamicdeformations. InProceedings of SIGGRAPH 2002, July2002.

[5] Robert D. Cook, David S. Malkus, and Michael E. Ple-sha.Concepts and Applications of Finite Element Analy-sis. John Wiley & Sons, New York, third edition, 1989.

[6] Gilles Debunne, Mathieu Desbrun, Marie-Paule Cani,and Alan H. Barr. Dynamic real-time deformations us-ing space and time adaptive sampling. InProceedings ofSIGGRAPH 2002, pages 31–36, July 2002.

[7] Petros Faloutsos, Michiel van de Panne, and Demetri Ter-zopoulos. Dynamic free-form deformations for animationsynthesis.IEEE Transactions on Visualization and Com-puter Graphics, 3(3):201–214, July 1997.

[8] Eitan Grinspun, Petr Krysl, and Peter Schroder. Charms:A simple framework for adaptive simulation. InProceed-ings of SIGGRAPH 2002, pages 281–290, July 2002.

[9] Doug L. James and Dinesh K. Pai. Artdefo - accurate realtime deformable objects. InProceedings of ACM SIG-GRAPH 99, pages 65–72, August 1999.

[10] Doug L. James and Dinesh K. Pai. Dyrt: Dynamic re-sponse textures for real time deformation simulation withgraphics hardware. InProceedings of SIGGRAPH 2002,pages 582–585, July 2002.

[11] Zachi Karni and Craig Gotsman. 3D mesh compressionusing fixed spectral bases. InGraphics Interface 2001,pages 1–8, June 2001.

[12] Paul G. Kry, Doug L. James, and Dinesh K. Pai. Eigen-skin: Real time large deformation character skinning in

hardware. InProceedings of the ACM SIGGRAPH 2002Symposium on Computer Animation, pages 153–160, July2002.

[13] Nuno M. M. Maia and Julio M. M. Silva, editors.Theoret-ical and Experimental Modal Analysis. Research StudiesPress, Hertfordshire, England, 1998.

[14] Dimitri Metaxas and Demetri Terzopoulos. Dynamic de-formation of solid primitives with constraints. InPro-ceedings of ACM SIGGRAPH 92, pages 309–312, July1992.

[15] Matthias Muller, Julie Dorsey, Leonard McMillan, RobertJagnow, and Barbara Cutler. Stable real-time deforma-tions. InProceedings of the ACM SIGGRAPH 2002 Sym-posium on Computer Animation, pages 49–54, July 2002.

[16] James F. O’Brien and Jessica K. Hodgins. Graphicalmodeling and animation of brittle fracture. InProceed-ings of SIGGRAPH 99, pages 137–146, August 1999.

[17] James F. O’Brien, Chen Shen, and Christine M.Gatchalian. Synthesizing sounds from rigid-body sim-ulations. InProceedings of the ACM SIGGRAPH 2002Symposium on Computer Animation, pages 175–181, July2002.

[18] Alex Pentland, Irfa Essa, Martin Friedmann, BradleyHorowitz, and Stan Sclaroff. The thingworld model-ing system: Virtual sculpting by modal forces. In1990Symposium on Interactive 3D Graphics, pages 143–144,March 1990.

[19] Alex Pentland and John Williams. Good vibrations:Modal dynamics for graphics and animation. InProceed-ings of SIGGRAPH 89, pages 215–222, July 1989.

[20] Xavier Provot. Deformation constraints in a mass-springmodel to describe rigid cloth behavior. InGraphics Inter-face 95, pages 147–154, May 1995.

[21] Thomas W. Sederberg and Scott R. Parry. Free-form de-formation of solid geometric models. InProceedings ofACM SIGGRAPH 86, pages 151–160, August 1986.

[22] Chen Shen, Kris K. Hauser, Christine M. Gatchalian, andJames F. O’Brien. Modal analysis for real-time viscoelas-tic deformation. InProceedings of SIGGRAPH 2002.

[23] Jos Stam. Stochastic dynamics: Simulating the effectsof turbulence on flexible structures.Computer GraphicsForum, 16(3):159–164, August 1997.

[24] Demetri Terzopoulos and Kurt Fleischer. Deformablemodels.The Visual Computer, 4(6):306–331, 1988.

[25] Gino van den Bergen. Efficient collision detection ofcomplex deformable models using AABB trees.Journalof Graphics Tools, 2(4):1–14, 1997.

[26] Kees van den Doel, Paul G. Kry, and Dinesh K. Pai. Foleyautomatic: Physically-based sound effects for interactivesimulation and animation. InProceedings of SIGGRAPH2001, pages 537–544, August 2001.

[27] Kees van den Doel and Dinesh K. Pai. Synthesis of shapedependent sounds with physical modeling. InProceed-ings of the International Conference on Auditory Display(ICAD), 1996.

[28] Kees van den Doel and Dinesh K. Pai. The sounds ofphysical shapes.Presence, 7(4):382–395, 1998.

[29] Kesheng Wu and Horst Simon. TRLAN user guide. Tech-nical Report LBNL-42953, Lawrence Berkeley NationalLaboratory, 1999.