logo资料库

An Introduction to the Finite Element Method.pdf

第1页 / 共10页
第2页 / 共10页
第3页 / 共10页
第4页 / 共10页
第5页 / 共10页
第6页 / 共10页
第7页 / 共10页
第8页 / 共10页
资料共10页,剩余部分请下载后查看
Position based dynamics
Introduction
Related work
Position based simulation
Algorithm overview
The solver
Constraint projection
Collision detection and response
Damping
Attachments
Cloth simulation
Representation of cloth
Collision with rigid bodies
Self collision
Cloth balloons
Results
Independent bending and stretching
Attachments with two way interaction
Real time self collision
Tearing and stability
Complex simulation scenarios
Conclusions
Future work
Acknowledgment
Gradient of the normalized cross product
Bending constraint projection
References
J. Vis. Commun. Image R. 18 (2007) 109–118 www.elsevier.com/locate/jvci Position based dynamics q Matthias Mu¨ ller a,*, Bruno Heidelberger a, Marcus Hennix a, John Ratcliff b a AGEIA Technologies, Technoparkstrasse 1, 8005 Zu¨ rich, Switzerland b AGEIA Technologies, 4041 Forest Park Avenue, St. Louis, MO 63108, USA Received 8 January 2007; accepted 9 January 2007 Available online 12 February 2007 Abstract The most popular approaches for the simulation of dynamic systems in computer graphics are force based. Internal and external forces are accumulated from which accelerations are computed based on Newton’s second law of motion. A time integration method is then used to update the velocities and finally the positions of the object. A few simulation methods (most rigid body simulators) use impulse based dynamics and directly manipulate velocities. In this paper we present an approach which omits the velocity layer as well and immediately works on the positions. The main advantage of a position based approach is its controllability. Overshooting problems of explicit integration schemes in force based systems can be avoided. In addition, collision constraints can be handled easily and penetrations can be resolved completely by projecting points to valid locations. We have used the approach to build a real time cloth simulator which is part of a physics software library for games. This application demonstrates the strengths and benefits of the method. Ó 2007 Elsevier Inc. All rights reserved. Keywords: Physically based simulation; Game physics; Integration schemes; Cloth simulation 1. Introduction Research in the field of physically based animation in computer graphics is concerned with finding new methods for the simulation of physical phenomena such as the dynamics of rigid bodies, deformable objects or fluid flow. In contrast to computational sciences where the main focus is on accuracy, the main issues here are stability, robustness and speed while the results should remain visually plausi- ble. Therefore, existing methods from computational sci- ences can not be adopted one to one. In fact, the main justification for doing research on physically based simula- tion in computer graphics is to come up with specialized methods, tailored to the particular needs in the field. The method we present falls into this category. The traditional approach to simulating dynamic objects has been to work with forces. At the beginning of each time q Reprinted with permission from Proc. Virtual Reality Interactions and Physical Simulations, Vriphys, Madrid, Spain, pp. 71–80, Nov. 6–7, 2006. * Corresponding author. Fax: +41 44 445 2147. E-mail address: mmueller@ageia.com (M. Mu¨ ller). 1047-3203/$ - see front matter Ó 2007 Elsevier Inc. All rights reserved. doi:10.1016/j.jvcir.2007.01.005 step, internal and external forces are accumulated. Exam- ples of internal forces are elastic forces in deformable objects or viscosity and pressure forces in fluids. Gravity and collision forces are examples of external forces. New- ton’s second law of motion relates forces to accelerations via the mass. So using the density or lumped masses of ver- tices, the forces are transformed into accelerations. Any time integration scheme can then be used to first compute the velocities from the accelerations and then the positions from the velocities. Some approaches use impulses instead of the animation. Because impulses directly change velocities, one level of integration can be skipped. forces to control In computer graphics and especially in computer games it is often desirable to have direct control over positions of objects or vertices of a mesh. The user might want to attach a vertex to a kinematic object or make sure the vertex always stays outside a colliding object. The method we pro- pose here works directly on positions which makes such manipulations easy. In addition, with the position based approach it is possible to control the integration directly thereby avoiding overshooting and energy gain problems
110 M. Mu¨ ller et al. / J. Vis. Commun. Image R. 18 (2007) 109–118 in connection with explicit integration. So the main fea- tures and advantages of position based dynamics are • Position based simulation gives control over explicit integration and removes the typical instability problems. • Positions of vertices and parts of objects can directly be manipulated during the simulation. • The formulation we propose allows the handling of gen- eral constraints in the position based setting. • The explicit position based solver is easy to understand and implement. 2. Related work The recent state of the art report ([1]) gives a good overview of the methods used in computer graphics to simulate deformable objects, e.g. mass-spring systems, the finite element method or finite difference approaches. Apart from the citation of ([2]), position based dynamics does not appear in this survey. However, parts of the posi- tion based approach have appeared in various papers without naming it explicitly and without defining a com- plete framework. Jakobsen ([3]) built his Fysix engine on a position based approach. His central idea was to use a Verlet integrator and manipulate positions directly. Because velocities are implicitly stored by current and the previ- ous positions, the velocities are implicitly updated by the position manipulation. While he focused mainly on distance constraints, he only gave vague hints on how more general constraints could be handled. In this paper we present a fully general approach which handles general constraints. We also focus on the important issue of conservation of linear and angular momenta by posi- tion projection. We work with explicit velocities instead of storing previous positions which makes damping and friction simulation much easier. Desbrun ([4]) and Provot ([5]) use constraint projection in mass spring systems to prevent springs from overstret- ching. In contrast to a full position based approach, projec- tion is only used as a polishing process for those springs that are stretched too much and not as the basic simulation method. Bridson et al. use a traditional force based approach for cloth simulation ([6]) and combine it with a geomet- ric collision resolving algorithm based on positions to make sure that the collision resolving impulses are kept within stable bounds. The same holds for the kinemati- cal collision correction step proposed by Volino et al. ([7]). A position based approach has been used by Clavet et al. ([8]) to simulate viscoelastic fluids. Their approach is not fully position based because the time step appears in various places of their position projections. Thus, the integration is only conditionally stable as regular explicit integration. Mu¨ ller et al. ([2]) simulate deformable objects by moving points towards certain goal positions which are found by matching the rest state to the current state of the object. Their integration method is the closest to the one we propose here. They only treat one specialized global constraint and, therefore, do not need a position solver. Fedor ([9]) uses Jakobsen’s approach to simulate char- acters in games. His method is tuned to the particular prob- lem of simulating human characters. He uses several skeletal them in sync via projections. representations and keeps Faure ([10]) uses a Verlet integration scheme by modify- ing the positions rather than the velocities. New positions are computed by linearizing the constraints while we work with the non linear constraint functions directly. We define general constraints via a constraint function as ([11]) and ([12]). Instead of computing forces as the derivative of a constraint function energy, we directly solve for the equilibrium configuration and project positions. With our method we derive a bending term for cloth which is similar to the one proposed in ([13]) and ([14]) but adopted to the point based approach. In Section 4 we use the position based dynamics approach for the simulation of cloth. Cloth simulation has been an active research field in computer graphics in recent years. Instead of citing the key papers of the field individually we refer the reader to ([1]) for a comprehensive survey. 3. Position based simulation In this section we will formulate the general position based approach. With cloth simulation, we will give a par- ticular application of the method in the subsequent and in the results section. We consider a three dimensional world. However, in two dimensions. the approach works equally well 3.1. Algorithm overview We represent a dynamic object by a set of N vertices and M constraints. A vertex i 2 [1, . . . , N] has a mass mi, a posi- tion xi and a velocity vi. A constraint j 2 [1, . . . , M] consists of • a cardinality nj, • a function Cj : R3nj ! R, • a set of indices fi1; . . . injg, ik 2 [1, . . . N], • a stiffness parameter kj 2 [0 . . . 1] and • a type of either equality or inequality. equality is Constraint j with type satisfied if Cjðxi1 ; . . . ; xinjÞ ¼ 0. If its type is inequality then it is satis- fied if Cjðxi1 ; . . . ; xinjÞ P 0. The stiffness parameter kj defines the strength of the constraint in a range from zero to one.
M. Mu¨ ller et al. / J. Vis. Commun. Image R. 18 (2007) 109–118 111 Based on this data and a time step Dt, the dynamic object is simulated as follows: initialize xi ¼ x0 i , vi ¼ v0 i , wi = 1/mi (1) forall vertices i (2) (3) endfor (4) loop (5) (6) (7) (8) forall vertices i do vi ‹ vi + Dtwifext(xi) dampVelocities(v1, . . . , vN) forall vertices i do pi ‹ xi + Dtvi forall vertices i generateCollisionConstraints(xi fi pi) do loop solverIterations times projectConstraints(C1; . . . ; CMþM coll ; p1; . . . ; pN ) (9) (10) (11) (12) (13) (14) (15) (16) (17) endloop endloop forall vertices i vi ‹ (pi xi)/Dt xi ‹ pi endfor velocityUpdate(v1, . . . , vN) Lines (1)–(3) just initialize the state variables. The core idea of position based dynamics is shown in lines (7), (9)– (11) and (13)–(14). In line (7), estimates pi for new locations of the vertices are computed using an explicit Euler integra- tion step. The iterative solver (9)–(11) manipulates these position estimates such that they satisfy the constraints. It does this by repeatedly project each constraint in a Gauss–Seidel type fashion (see Section 3.2). In steps (13) and (14), the positions of the vertices are moved to the opti- mized estimates and the velocities are updated accordingly. This is in exact correspondence with a Verlet integration step and a modification of the current position ([3]), because the Verlet method stores the velocity implicitly as the difference between the current and the last position. However, working with velocities allows for a more intui- tive way of manipulating them. The velocities are manipulated in line (5), (6) and (16). Line (5) allows to hook up external forces to the system if some of the forces cannot be converted to positional con- straints. We only use it to add gravity to the system in which case the line becomes vi ‹ vi + Dtg, where g is the gravitational acceleration. In line (6), the velocities can be damped if this is necessary. In Section 3.5 we show how to add global damping without influencing the rigid body modes of the object. Finally, in line (16), the velocities of colliding vertices are modified according to friction and restitution coefficients. The given constraints C1, . . . , CM are fixed throughout the simulation. In addition to these constraints, line (8) generates the Mcoll collision constraints which change from time step to time step. The projection step in line (10) con- siders both, the fixed and the collision constraints. The scheme is unconditionally stable. This is because the integration steps (13) and (14) do not extrapolate blindly into the future as traditional explicit schemes do but move the vertices to a physically valid configuration pi computed by the constraint solver. The only possible source for insta- bilities is the solver itself which uses the Newton-Raphson method to solve for valid positions (see Section 3.3). How- ever, its stability does not depend on the time step size but on the shape of the constraint functions. The integration does not fall clearly into the category of implicit or explicit schemes. If only one solver iteration is performed per time step, it looks more like an explicit scheme. By increasing the number of iterations, however, a constrained system can be made arbitrarily stiff and the algorithm behaves more like an implicit scheme. Increasing the number of iterations shifts the bottleneck from collision detection to the solver. 3.2. The solver The input to the solver are the M + Mcoll constraints and the estimates p1, . . . , pN for the new locations of the points. The solver tries to modify the estimates such that they satisfy all the constraints. The resulting system of equations is non-linear. Even a simple distance constraint C(p1, p2) = jp1 p2j d yields a non-linear equation. In addition, the constraints of type inequality yield inequali- ties. To solve such a general set of equations and inequal- ities, we use a Gauss–Seidel-type iteration. The original Gauss–Seidel algorithm (GS) can only handle linear sys- tem. The part we borrow from GS is the idea of solving each constraint independently one after the other. How- ever, in contrast to GS, solving a constraint is a non linear operation. We repeatedly iterate through all the constraints and project the particles to valid locations with respect to the given constraint alone. In contrast to a Jacobi-type iter- ation, modifications to point locations immediately get vis- ible to the process. This speeds up convergence significantly because pressure waves can propagate through the material in a single solver step, an effect which is dependent on the order in which constraints are solved. In over-constrained situations, the process can lead to oscillations if the order is not kept constant. 3.3. Constraint projection Projecting a set of points according to a constraint means moving the points such that they satisfy the con- straint. The most important issue in connection with mov- ing points directly inside a simulation loop is the conservation of linear and angular momentum. Let Dpi be the displacement of vertex i by the projection. Linear momentum is conserved if X miDpi ¼ 0; i ð1Þ X which amounts to conserving the center of mass. Angular momentum is conserved if ri  miDpi ¼ 0; i ð2Þ
112 M. Mu¨ ller et al. / J. Vis. Commun. Image R. 18 (2007) 109–118 Fig. 1. A known deformation benchmark test, applied here to a cloth character under pressure. P s ¼ where the ri are the distances of the pi to an arbitrary com- mon rotation center. If a projection violates one of these constraints, it introduces so called ghost forces which act like external forces dragging and rotation the object. How- ever, only internal constraints need to conserve the momenta. Collision or attachment constraints are allowed to have global effects on the object. 1 ; . . . ; pT The method we propose for constraint projection con- serves both momenta for internal constraints. Again, the point based approach is more direct in that we can directly use the constraint function while force based methods derive forces via an energy term (see ([11,12])). Let us look at a constraint with cardinality n on the points p1, . . . , pn with constraint function C and stiffness k. We let p be the concatenation ½pT nŠT . For internal constraints, C is independent of rigid body modes, i.e. translation and rota- tion. This means that rotating or translating the points does not change the value of the constraint function. Therefore, the gradient $pC is perpendicular to rigid body modes because it is the direction of maximal change. If the correction Dp is chosen to be along $Cp both momenta are automatically conserved if all masses are equal (we handle different masses later). Given p we want to find a correction Dp such that C(p + Dp) = 0. This equation can be approx- imated by Cðp þ DpÞ  CðpÞ þ rpCðpÞ  Dp ¼ 0: Restricting Dp to be in the direction of $pC means choosing a scalar k such that Dp ¼ krpCðpÞ: Substituting Eq. (4) into Eq. (3), solving for k and substi- tuting it back into Eq. (4) yields the final formula for Dp ð5Þ Dp ¼ CðpÞ ð3Þ ð4Þ jrpCðpÞj2 rpCðpÞ; which is a regular Newton-Raphson step for the iterative solution of the non-linear equation given by a single con- straint. For the correction of an individual point pi we have Dpi ¼ srpiCðp1; . . . ; pnÞ; ð6Þ where the scaling factor Cðp1; . . . ; pnÞ jjrpjCðp1; . . . ; pnÞj2 ð7Þ is the same for all points. If the points have individual masses, we extend the Newton–Raphson process by weight- ing the corrections proportional to the inverse masses wi = 1/mi Dpi ¼ s ð8Þ rpiCðp1; . . . ; pnÞ; n  wiP jwj to points To give an example, let us consider the distance constraint function C(p1,p2) = jp1 p2j d. The derivative with re- are rp1Cðp1; p2Þ ¼ n spect the and rp2Cðp1; p2Þ ¼ n with n ¼ p1p2 jp1p2j. The scaling factor s is, thus, s ¼ jp1p2jd 1þ1 Dp1 ¼ w1 w1 þ w2 Dp2 ¼ þ w2 w1 þ w2 ðjp1 p2j dÞ p1 p2 jp1 p2j ; ðjp1 p2j dÞ p1 p2 jp1 p2j ; and the final corrections ð9Þ ð10Þ which are the formulas proposed in ([3]) for the projection of distance constraints (see Fig. 2). They pop up as a spe- cial case of the general constraint projection method. We have not considered the type and the stiffness k of the constraint so far. Type handling is straight forward. If the type is equality we always perform a projection. If the type is inequality, the projection is only performed if C(p1, . . ., pn) < 0. There are several ways of incorporating the stiffness parameter. The simplest variant is to multiply the corrections Dp by k 2 [0 . . . 1]. However, for multiple iteration loops of the solver, the effect of k is non-linear. The remaining error for a single distance constraint after ns solver iterations is Dpð1 kÞns . To get a linear relation- ship we multiply the corrections not by k directly but by k0 ¼ 1 ð1 kÞ1=ns. With this transformation the error becomes Dpð1 k0Þns ¼ Dpð1 kÞ and, thus, becomes line- arly dependent on k and independent of ns as desired. How- 2pΔ 2m 2p 1pΔ d 1m 1p Fig. 2. Projection of the constraint C(p1, p2) = jp1 p2j d. The correc- tions Dpi are weighted according to the inverse masses wi = 1/mi.
M. Mu¨ ller et al. / J. Vis. Commun. Image R. 18 (2007) 109–118 113 ever, the resulting material stiffness is still dependent on the time step of the simulation. Real time environments typi- cally use fixed time steps in which case this dependency is not problematic. 3.4. Collision detection and response the simulation, One advantage of the position based approach is how simply collision response can be realized. In line (8) of the simulation algorithm the Mcoll collision constraints are gen- erated. While the first M constraints given by the object rep- resentation are fixed throughout the additional Mcoll constraints are generated from scratch at each time step. The number of collision constraints Mcoll varies and depends on the number of colliding vertices. Both, continuous and static collisions can be handled. For continuous collision handling, we test for each vertex i the ray xi fi pi. If this ray enters an object, we compute the entry point qc and the surface normal nc at this position. An inequality constraint with constraint function C(p) = (p qc) Æ nc and stiffness k = 1 is added to the list of con- straints. If the ray xi fi pi lies completely inside an object, continuous collision detection has failed at some point. In this case we fall back to static collision handling. We com- pute the surface point qs which is closest to pi and the surface normal ns at this position. An inequality constraint with con- straint function C(p) = (p qs) Æ ns and stiffness k = 1 is added to the list of constraints. Collision constraint genera- tion is done outside of the solver loop. This makes the sim- ulation much faster. There are certain scenarios, however, where collisions can be missed if the solver works with a fixed collision constraint set. Fortunately, according to our experience, the artifacts are negligible. Friction and restitution can be handled by manipulating the velocities of colliding vertices in step (16) of the algo- rithm. The velocity of each vertex for which a collision con- straint has been generated is dampened perpendicular to the collision normal and reflected in the direction of the collision normal. The collision handling discussed above is only correct for collisions with static objects because no impulse is transferred to the collision partners. Correct response for two dynamic colliding objects can be achieved by simulat- ing both objects with our simulator, i.e. the N vertices and M constraints which are the input to our algorithm simply represent two or more independent objects. Then, if a point q of one objects moves through a triangle p1, p2, p3 of another object, we insert an inequality constraint with con- straint function C(q, p1, p2, p3) = ±(q p1) Æ [(p2 p1) · (p3 p1)] which keeps the point q on the correct side of the triangle. Since this constraint function is independent of rigid body modes, it will correctly conserve linear and angular momentum. Collision detection gets slightly more involved because the four vertices are represented by rays xi fi pi. Therefore the collision of a moving point against a moving triangle needs to be detected (see section about cloth self collision). 3.5. Damping   P P   i mi imi imi iximi ivimi In line (6) of the simulation algorithm the velocities are dampened before they are used for the prediction of the new positions. Any form of damping can be used and many methods for damping have been proposed in the literature (see ([1])). Here we propose a new method with some inter- P esting properties: P P (1) xcm ¼ = P (2) vcm ¼ = iri · (mivi) (3) L = (4) I ¼ i~ri~rT 1L (5) x = I (6) forall vertices i (7) (8) (9) endfor Here ri = xi xcm, ~ri is the 3 by 3 matrix with the prop- erty ~riv ¼ ri  v, and kdamping 2 [0 . . . 1] is the damping coefficient. In lines (1)–(5) we compute the global linear velocity xcm and angular velocity x of the system. Lines (6)–z(9) then only damp the individual deviations Dvi of the velocities vi from the global motion vcm + x · ri. Thus, in the extreme case kdamping = 1, only the global motion survives and the set of vertices behaves like a rigid body. For arbitrary values of kdamping, the velocities are globally dampened but without influencing the global motion of the vertices. Dvi = vcm + x · ri vi vi ‹ vi + kdamping Dvi 3.6. Attachments With the position based approach, attaching vertices to static or kinematic objects is quite simple. The position of the vertex is simply set to the static target position or updated at every time step to coincide with the position of the kinematic object. To make sure other constraints containing this vertex do not move it, its inverse mass wi is set to zero. 4. Cloth simulation We have used the point based dynamics framework to implement a real time cloth simulator for games. In this section we will discuss cloth specific issues thereby giving concrete examples of the general concepts introduced in the previous section. 4.1. Representation of cloth Our cloth simulator accepts as input arbitrary triangle meshes. The only restriction we impose on the input mesh is that it represents a manifold, i.e. each edge is shared by at most two triangles. Each node of the mesh becomes a sim- ulated vertex. The user provides a density q given in mass per area [kg/m2]. The mass of a vertex is set to the sum
114 M. Mu¨ ller et al. / J. Vis. Commun. Image R. 18 (2007) 109–118 of one third of the mass of each adjacent triangle. For each edge, we generate a stretching constraint with constraint function Cstretchðp1; p2Þ ¼ jp1 p2j l0; stiffness kstretch and type equality. The scalar l0 is the initial length of the edge and kstretch is a global parameter pro- vided by the user. It defines the stretching stiffness of the cloth. For each pair of adjacent triangles (p1, p3, p2) and (p1, p2, p4) we generate a bending constraint with constraint function Cbendðp1;p2;p3;p4Þ ¼arccos  jðp2p1Þðp3p1Þj ðp2p1Þðp4p1Þ ðp2p1Þðp3p1Þ jðp2p1Þðp4p1Þj u0;  stiffness kbend and type equality. The scalar u0 is the initial dihedral angle between the two triangles and kbend is a glo- bal user parameter defining the bending stiffness of the cloth (see Fig. 4). The advantage of this bending term over adding a distance constraint between points p3 and p4 or over the bending term proposed by ([13]) is that it is inde- pendent of stretching. This is because the term is indepen- dent of edge lengths. This way, the user can specify cloth with low stretching stiffness but high bending resistance for instance (see Fig. 3). Eqs. (9) and (10) define the projection for the stretching constraints. In the Appendix B we derive the formulas to project the bending constraints. 4.2. Collision with rigid bodies For collision handling with rigid bodies we proceed as described in Section 3.4. To get two-way interactions, we apply an impulse miDpi/Dt to the rigid body at the con- tact point, each time vertex i is projected due to collision with that body. Testing only cloth vertices for collisions is not enough because small rigid bodies can fall through large cloth triangles. Therefore, collisions of the convex 2p 1n 3p 1p 2n 1n 1,2p ϕ 4p 3p 2n 4p Fig. 4. For bending resistance, the constraint function C(p1, p2, p3, p4) = arccos(n1 Æ n2) u0 is used. The actual dihedral angle u is measure as the angle between the normals of the two triangles. corners of rigid bodies against the cloth triangles are also tested. 4.3. Self collision Assuming that the triangles all have about the same size, we use spatial hashing to find vertex triangle collisions ([15]). If a vertex q moves through a triangle p1, p2, p3, we use the constraint function Cðq; p1; p2; p3Þ¼ðq p1Þ ðp2 p1Þðp3 p1Þ jðp2 p1Þðp3 p1Þj h; ð11Þ where h is the cloth thickness (see Fig. 5). If the vertex en- ters from below with respect to the triangle normal, the constraint function has to be Cðq; p1; p2; p3Þ ¼ ðq p1Þ  ðp3 p1Þ  ðp2 p1Þ jðp3 p1Þ  ðp2 p1Þj h ð12Þ 2p n q 3p n q h 1p 3p 1p 2p Fig. 5. Constraint function C(q, p1, p2, p3) = (q p1) Æ n h makes sure that q stays above the triangle p1, p2, p3 by the the cloth thickness h. Fig. 3. With the bending term we propose, bending and stretching are independent parameters. The top row shows ðkstretching; kbendingÞ ¼ ð1; 1Þ;ð1 100 ; 1Þ. The bottom row shows ðkstretching; kbendingÞ ¼ ð1; 0Þ;ð1 ð 1 2 ; 0Þ and ð 1 100 ; 0Þ. 2 ; 1Þ and
M. Mu¨ ller et al. / J. Vis. Commun. Image R. 18 (2007) 109–118 115 experiments have been carried out to analyze the character- istics and the performance of the proposed method. All test scenarios presented in this section have been performed on a PC Pentium 4, 3 GHz. 5.1. Independent bending and stretching Our bending term only depends on the dihedral angle of adjacent triangles, not on edge lengths, so bending and stretching resistances can be chosen independently. Fig. 3 shows a cloth bag with various stretching stiffnesses, first with bending resistance enabled and then disabled. As the top row shows, bending does not influence stretching resistance. 5.2. Attachments with two way interaction We can simulate both, one way and two way coupled attachment constraints. The cloth stripes in Fig. 8 are attached via one way constraints to the static rigid bodies at the top. In addition, two way interaction is enabled between the stripes and the bottom rigid bodies. This con- figuration results in realistically looking swing and twist motions of the stripes. The scene features 6 rigid bodies and 3 pieces of cloth which are simulated and rendered with more than 380 fps. Fig. 6. This folded configuration demonstrates stable self collision and response. to keep the vertex on the original side. Projecting these con- straints conserves linear and angular momentum which is essential for cloth self collision since it is an internal pro- cess. Fig. 6 shows a rest state of a piece of cloth with self collisions. Testing continuous collisions is insufficient if cloth gets into a tangled state, so methods like the ones proposed by ([16]) have to be applied. 4.4. Cloth balloons For closed triangle meshes, overpressure inside the mesh can easily be modeled (see Fig. 7). We add an equality con- straint concerning all N vertices of the mesh with constraint function ! X ntriangles i¼1 Cðp1; . . . ; pNÞ ¼ ðpti 1  pti 2 Þ  pti 3 kpressureV 0 ð13Þ 5.3. Real time self collision 1, ti and stiffness k = 1 to the set of constraints. Here ti 2 and ti 3 are the three indices of the vertices belonging to triangle i. The sum computes the actual volume of the closed mesh. It is compared against the original volume V0 times the overpressure factor kpressure. This constraint function yields the gradients ðptj rpiC ¼ X X X  ptj  ptj Þ: ð14Þ Þþ  ptj 3 Þþ 2 ðptj 1 ðptj 3 2 1¼i j:t j 2¼i j:t j 1 3¼i j:t j These gradients have to be scaled by the scaling factor gi- ven in Eq. (7) and weighted by the masses according to Eq. (8) to get the final projection offsets Dpi. 5. Results We have integrated our method into Rocket ([17]), a game-like environment for physics simulation. Various The piece of cloth shown in Fig. 6 is composed of 1364 vertices and 2562 triangles. The simulation runs at 30 fps on average including self collision detection, collision han- dling and rendering. The effect of friction is shown in Fig. 9, where the same piece of cloth is tumbling in a rotat- ing barrel. 5.4. Tearing and stability Fig. 10 shows a piece of cloth consisting of 4264 vertices and 8262 triangles that is torn open by an attached cube and finally ripped apart by a thrown ball. This scene is sim- ulated and rendered with 47 fps on average. Tearing is sim- ulated by a simple process: whenever the stretching of an edge exceeds a specified threshold value, we select one of the edge’s adjacent vertices. We then put a split plane through that vertex perpendicular to the edge direction Fig. 7. Simulation of overpressure inside a character.
116 M. Mu¨ ller et al. / J. Vis. Commun. Image R. 18 (2007) 109–118 Fig. 8. Cloth stripes are attached via one way interaction to static rigid bodies at the top and via two way constraints to rigid bodies at the bottom. Fig. 9. Influenced by collision, self collision and friction, a piece of cloth tumbles in a rotating barrel. Fig. 10. A piece of cloth is torn open by an attached cube and ripped apart by a thrown ball. Fig. 11. Three inflated characters experience multiple collisions and self collisions. and split the vertex. All triangles above the split plane are assigned to the original vertex while all triangles below are assigned to the duplicate. Our method remains stable even in extreme situations as shown in Fig. 1, a scene inspired by ([18]). An inflated character model is squeezed through rotating gears resulting in multiple constraints, collisions and self collisions acting on single cloth vertices (Fig. 11). 5.5. Complex simulation scenarios The presented method is especially suited for complex simulation environments (see Fig. 12). Despite the exten- sive interaction with animated characters and geometrically complex game levels, simulation and rendering of multiple pieces of cloth can still be done at interactive speed.
分享到:
收藏