[go: up one dir, main page]

WO2007102845A2 - Method of simulating dynamic objects using position based dynamics - Google Patents

Method of simulating dynamic objects using position based dynamics Download PDF

Info

Publication number
WO2007102845A2
WO2007102845A2 PCT/US2006/036514 US2006036514W WO2007102845A2 WO 2007102845 A2 WO2007102845 A2 WO 2007102845A2 US 2006036514 W US2006036514 W US 2006036514W WO 2007102845 A2 WO2007102845 A2 WO 2007102845A2
Authority
WO
WIPO (PCT)
Prior art keywords
vertex
constraint
constraints
vertices
velocity
Prior art date
Application number
PCT/US2006/036514
Other languages
French (fr)
Other versions
WO2007102845A3 (en
Inventor
Matthias Müller
Bruno Heidelberger
Marcus Hennix
Original Assignee
Ageia Technologies, Inc.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from US11/368,407 external-priority patent/US7616204B2/en
Application filed by Ageia Technologies, Inc. filed Critical Ageia Technologies, Inc.
Publication of WO2007102845A2 publication Critical patent/WO2007102845A2/en
Publication of WO2007102845A3 publication Critical patent/WO2007102845A3/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation

Definitions

  • Embodiments of the present invention relate generally to methods of simulating dynamic objects. More particularly, embodiments of the present invention relate to methods of simulating dynamic objects using position based dynamics.
  • Contemporary video games tend to incorporate a variety of sophisticated effects designed to mimic the behavior of objects in the real world. These effects include, for example, simulated collisions, explosions, object deformations, and so on.
  • One recent approach that game developers have used to generate these effects is to simulate the movement and interaction of objects using the laws of physics.
  • a video game may model objects such as fluids, clothing, people, and so on, as collections of vertices that are animated by applying forces such as gravity, pressure, friction, viscosity, surface tension, mass-spring forces, and impact, to each vertex.
  • Computational simulations that rely on the laws of physics are referred to in this written description as "physics simulations.”
  • a virtual object that is susceptible to animation (e.g., movement or deformation) in a physics simulation is referred to in this written description as a "dynamic object.”
  • a dynamic object is typically modeled as a collection of vertices, each having a position, a mass, and a velocity.
  • the positions and velocities of the vertices are updated over time to simulate motion.
  • the vertices may be connected together, i.e. constrained by topology.
  • each vertex may be unconnected from the other vertices.
  • FIG. 1 A conventional method of performing a physics simulation on a dynamic object is shown, for example, in Figure (Fig.) 1.
  • exemplary method steps are denoted by parentheses (XXX).
  • the method comprises accumulating a plurality of forces at each vertex of a dynamic object (101).
  • the method further comprises computing an acceleration for each vertex based the vertex's mass and the accumulated forces on the vertex (102).
  • the acceleration is generally computed by Newton's second law of motion, which states that acceleration equals force divided by mass.
  • the vertex's acceleration is then used to update the vertex's velocity (103), and finally, the vertex's new velocity is used to update its position (104).
  • steps (101) through (104) are carried out at predetermined timesteps throughout the simulation. As such, changes in a vertex's velocity and position are generally calculated by respectively integrating the vertex's acceleration and velocity over each timestep.
  • the method of Fig. 1 can use a variety of different numerical techniques to update the velocities and positions.
  • some common techniques include various forms of implicit or explicit integration, and finite element method or finite difference approaches.
  • One variation of the method illustrated in Fig. 1 uses impulses rather than forces to control vertex animation in the physics simulation. Because impulses directly impact velocities, using impulses allows velocities to be updated without performing an integration step on the accelerations. In other words, the impulses can be used instead of performing steps (101) and (102).
  • the velocity of each vertex is implicitly stored by current and previous (or current and next) positions of the vertex.
  • Two conventional examples of how the vertex positions may be manipulated include (1) moving each vertex toward a predefined goal position defined by a rest state of the dynamic object, or (2) moving each vertex to a position that satisfies a predetermined positional constraint of the vertex.
  • position based approaches to dynamic object simulation allow increased control over explicit integration, which prevents vertex positions from being adversely affected by numerical instability of the integration.
  • vertex positions since the vertex positions are directly manipulated, the vertices can be easily attached to kinematic objects and they can be prevented from penetrating other objects.
  • position based approaches tend to be easy to understand, to implement, and debug.
  • embodiments of the present invention provide several position based techniques capable of manipulating the positions of vertices in a dynamic object based on a general set of constraints. Selected embodiments of the invention also address the problem of conserving linear and angular momentum in the dynamic objects by position projection. Further, in some embodiments of the invention, vertex velocities are represented explicitly to simplify the simulation of damping and friction. [0013] According to one embodiment of the invention, a method of simulating a dynamic object comprising a plurality of vertices, is provided.
  • the method comprises defining a current position and a current velocity for a vertex "v" among the plurality of vertices, generating an estimated next position for vertex "v” based on the current position and current velocity, updating the estimated next position based on a plurality of constraints, and after updating the estimated next position, computing a next position and a next velocity for vertex "v” based on the current position and estimated next position.
  • a method of updating a position of a vertex associated with a dynamic object in a dynamic object simulation comprises projecting the vertex onto a constraint by updating a position of the vertex along a gradient of a constraint function associated with the constraint.
  • a method of performing a cloth simulation comprises modeling a piece of cloth as a mesh, wherein nodes of the mesh define locations of vertices of a dynamic object.
  • the method further comprises updating a position of a vertex "v" among the vertices by projecting vertex "v" onto a bending constraint and a stretching constraint using a Gauss-Seidel type iterative procedure.
  • Fig. 1 shows a conventional method of simulating a dynamic object
  • Fig. 2 illustrates a method of simulating a dynamic object according to one embodiment of the present invention
  • Fig. 3 illustrates a set of two vertices whose positions is governed by a distance constraint
  • FIG. 4 illustrates a method of simulating a dynamic object according to another embodiment of the present invention
  • Fig. 5 shows a piece of cloth modeled by a triangular mesh
  • Fig. 6 shows a collision involving a vertex and a simulated piece of cloth.
  • embodiments of the present invention provide methods of simulating dynamic objects using a position-based approach.
  • the position based- approach allows video game developers to generate realistic-looking animations while achieving the computational efficiency required for real-time interactive video games.
  • embodiments of the invention are particularly suited to video games, embodiments of the invention can also be adapted for use in other application areas such as computer graphics, scientific modeling, computer generated imagery, and so on.
  • Embodiments of the invention can be implemented in any of a variety of software configurations, or on any of a variety of computing platforms.
  • a dynamic object simulation can be run as a single application on a general purpose central processing unit (CPU), or as a secondary application running in parallel with a main application.
  • the dynamic object simulation is run as a secondary application, the secondary application may run on the same processor as the main application, or on another processor such as a physics processing unit, or another CPU.
  • Several different software and hardware configurations for running a dynamic object simulation according to various embodiments of the present invention are disclosed, for example, in U.S. Patent Applications with serial numbers 10/715,459, 10/815,721, and 10/982,791.
  • a dynamic object is modeled by a set of vertices, where each vertex is characterized by a position in a three dimensional (3D) virtual space, a velocity, and a mass.
  • the position of each vertex is governed by a corresponding set of constraints such that when the dynamic object is simulated, the position of each vertex is updated in accordance with the constraints. Since a vertex's velocity is related to its change in position, each vertex's velocity is generally updated along with its position.
  • Fig. 2 shows a simple example of how a dynamic object may be simulated according to one embodiment of the invention. Referring to Fig.
  • a method of simulating a dynamic object comprises initializing a set of vertex parameters corresponding to a set of vertices of the dynamic object (201).
  • the vertex parameters comprise a vertex position, a velocity, and a mass for each of the vertices.
  • the method further comprises projecting the vertices onto the constraints to generate new vertex positions and velocities (202), and then replacing current vertex positions and velocities with the new vertex positions and velocities (203).
  • the simulation then proceeds by repeating steps (202) and (203).
  • the term "constraint" refers broadly to any set of mathematical, geometrical, or algorithmic relationships used to determine a vertex's position.
  • a constraint may define a desired distance or distance range between the positions of two vertices within the same dynamic object. Such a constraint is referred to as a "distance constraint.” Where the actual distance between the two vertices is the same as the desired distance or is within the desired distance range, the vertices are said to "satisfy" the distance constraint. Similarly, whenever the relationship defined by any type of constraint is true with respect to a particular vertex or vertex position, the vertex or vertex position is considered to "satisfy" the constraint. In step (202) of Fig. 2, the vertices are "projected" onto the constraints by moving the vertices to new positions such that the vertices either satisfy or at least approximate the constraints.
  • Equation form the process of projecting a vertex onto a constraint can be described as follows.
  • Fig. 3 shows a set of two (2) vertices with positions p-i and p 2 which are governed by a distance constraint with the following constraint function:
  • C(pi, p 2 ) IP1-P 2 I - d, where d is the desired distance between vertices pi and P 2 .
  • vertex positions may also be governed by collision constraints, attachment constraints, linear momentum constraints, and angular momentum constraints, to name but a few.
  • collision constraints define boundaries for a vertex's motion.
  • the collision constraints may define limits at which a vertex will collide with another object or surface in the dynamic object simulation.
  • a vertex is considered to satisfy a particular collision constraint whenever the vertex's position does not extend beyond the boundaries defined by the collision constraint.
  • An attachment constraint requires a first vertex's position to be linked with a second vertex's position within the simulation. Based on the linking, whenever the position of the first vertex changes, the position of the second vertex also changes, or vice versa. Accordingly, attachment constraints can be used, for example, to bind the motion of one dynamic object to the motion of another dynamic object or a static object in a simulation.
  • a simple way to implement an attachment constraint is to simply set a vertex's position to a static target position, or update the vertex's position at every timestep to coincide with the position to a target position on a kinematic object.
  • the inverse mass of the vertex can be set to zero.
  • Linear and angular momentum constraints require that changes in vertex positions due to the internal constraints of a dynamic object conserve linear and angular momentum of the object.
  • the term "internal constraints” here denotes constraints related entirely to components (e.g., vertices) within the dynamic object. For instance, distance constraints are generally considered to be internal constraints since they typically only involve vertices within the same dynamic object. In contrast, collision and attachment constraints are external constraints because they relate to external boundaries and objects.
  • linear and angular momentum constraints take into account changed positions for all vertices in a dynamic object. For instance, a linear momentum constraint for a dynamic object including several vertices is satisfied when the vertices change positions such that the following relationship (1) is true:
  • relationship (1) denotes the mass of the /* vertex of the dynamic object, and ⁇ p,- denotes a change in the /* vertex's position.
  • relationship (1) Another way of stating relationship (1) is that the dynamic object's center of mass must stay the same after its vertex positions change in order for the dynamic object's linear momentum constraint to be satisfied.
  • the angular momentum constraint for the dynamic object is satisfied when the vertices change positions such that the following relationship (2) is true:
  • r denotes a distance from the /* vertex to an arbitrary center of rotation for the dynamic object.
  • new positions for the vertices of a deformable object can be generated by first predicting the new positions and then using the constraints to modify the predicted new positions.
  • Fig. 4 illustrates a method of simulating a dynamic object wherein predicted vertex positions are used to generate new vertex positions.
  • the method comprises initializing a set of vertex parameters for a deformable object (401).
  • the vertex parameters include a position, mass, and velocity for each vertex associated with the deformable object.
  • the method further comprises computing new positions for the vertices based on their respective current velocities (402).
  • the new positions are then modified based on constraints associated with the vertices (403).
  • the vertex velocities are updated with the respective differences between the modified new positions and their corresponding current vertex positions, divided by a timestep (404).
  • the vertex positions are updated with the respective modified new position estimates (405).
  • the following exemplary simulation algorithm illustrates one way of implementing the method illustrated in Fig. 4.
  • a dynamic object is represented by a set of " ⁇ T vertices and "M" positional constraints.
  • the object's motion is also governed by M ⁇ n collision constraints.
  • each vertex / e [l,...,N] has a mass m u a position x h and a velocity V 1 .
  • each constraint j e [1,...,M] includes a cardinality n b a function C, : F ⁇ 3nj -> R, a set of indices ⁇ /i,.../,,, ⁇ , / fe e[1 ,... ⁇ /], a stiffness parameter /c ; e[0...1], and a type of either "inequality” or "equality".
  • the stiffness parameter k defines the strength of the constraint in a range from zero to one.
  • the simulation algorithm is defined as follows:
  • lines (1)-(3), (7), (9)-(11), and (12)-(15) correspond to respective steps (401), (402), (403), and (404)-(405) in Fig. 4.
  • Lines (1)-(3) initialize the positions, velocities, and masses of the vertices.
  • Line (5) computes an estimated velocity for each vertex based on the vertex's current velocity and any external forces acting on the dynamic object at the vertex's position.
  • Line (7) computes an new position "p" for each vertex "/" in the dynamic object based on the vertex's current position X / and velocity estimate.
  • Lines (9)-(11) modify new positions "p" by projecting the constraints onto the new positions, and then lines (12)-(15) update vertex positions x, and velocities v, based on the modified new positions.
  • lines (5) and (7) velocity estimates and new position estimates p, are computed using an explicit Euler integration step with a timestep ⁇ t.
  • Line (5) takes external forces f ext ( ⁇ ') that cannot be converted into positional constraints and uses them to compute the velocity estimates.
  • line (5) generally includes gravity as an external force, so that line (5) becomes v, ⁇ - v, + Atg , where "g" stands for acceleration due to gravity.
  • line (6) executes a velocity damping operation on the estimated velocities
  • line (8) generates the M co ⁇ collision constraints
  • line (16) uses friction and restitution coefficients to modify the velocities of any vertices affected by collisions.
  • Lines (9)-(11) use an iterative process to modify new positions "p" so that they satisfy the "M” positional constraints and the "M 00 Ii" collision constraints.
  • One way to implement the iterative process is with Gauss-Seidel-type iteration.
  • Gauss-Seidel type iteration loops through the M + M co ⁇ constraints, and with each loop, it projects each vertex of the dynamic object onto a new location satisfying a single one of the constraints. In the Gauss-Seidel type iteration, the new vertex locations immediately become available to the iterative process, thus speeding up convergence.
  • equation (5) By substituting equation (4) into equation (3), solving for ⁇ , and then substituting the value for ⁇ into equation (4), the following equation (5) can be derived for ⁇ p:
  • Equation (5) defines a regular Newton-Raphson step for the iterative solution of a non-linear equation.
  • stiffness parameter "k” there are many ways to incorporate stiffness parameter "k" into the dynamic object simulation.
  • One way is to simply multiply each of position changes ⁇ p by k.
  • the difference between ⁇ p with and without stiffness parameter "k” will depend non-linearly based on the number of loops that are performed.
  • the difference between ⁇ p with and without stiffness parameter "/c” will be Ap(I- k)"' .
  • Line (8) of the simulation algorithm generates collision constraints for the dynamic object simulation.
  • the number of collision constraints that are generated in each timestep varies according to the number of vertices that collide with other objects in the simulation. Colliding vertices are detected by testing each vertex "/" of the dynamic object to see whether a line segment between original position X ⁇ and new position p, enters another object. If the line segment enters a second object, the algorithm computes an entry point q c and a surface normal n c of the second object at entry point q c .
  • the collision detection has failed at some point.
  • This problem can be addresses by computing a surface point q s of the other object that is closest to new position p,, and the surface normal n s of the other object at surface point q s .
  • Line (16) of the simulation algorithm handles friction and restitution for the collisions by damping the velocity of each colliding vertex in a direction perpendicular to surface normal n c or n s and reflecting the velocity of each colliding vertex in a direction toward surface normal n c or n s .
  • This constraint function is independent of the rigid body modes of the objects, and therefore it will conserve the objects' linear and angular momentum.
  • collisions can be defined in relation to other surfaces of simulated objects, including, for example, the plane of an arbitrary polygon or a curved surface.
  • Line (6) of the simulation algorithm damps the velocities of each of the N vertices.
  • the following damping subroutine illustrates one way to perform the damping: (2) v Cffl
  • Lines (1) through (5) of the damping subroutine compute a global linear velocity x cm and angular velocity ⁇ for the dynamic object.
  • Lines (6) through (9) of the damping subroutine damp individual deviations ⁇ v, from the global motion v cm + ⁇ * r,-.
  • the velocities are globally dampened but without influencing the global motion of the vertices.
  • Selected embodiments of the invention can be used to simulate cloth.
  • a piece of cloth can be represented as a triangular mesh wherein each node of the mesh represents a vertex of a simulated dynamic object.
  • the triangular mesh has a density p defined in mass per area (e.g., kg/m 2 ), and the mass of each vertex is set to the sum of one third of the area of each adjacent triangle times p.
  • p defined in mass per area
  • a scalar / 0 is an initial length of the edge and stretching stiffness k s t re tc h is a global constraint typically defined by a user and defining a stretching stiffness of the piece of cloth.
  • each pair of adjacent triangles in the mesh has a bending constraint, which is explained below with reference to Fig. 5.
  • Fig. 5 shows a piece of cloth modeled by a triangular mesh including first and second triangles (P 1 , p 3 , p 2 ) and (pi, P2, P 4 ), where pi through p 4 are the positions of respective first through fourth vertices of the mesh.
  • First triangle (P 1 , p 3 , P 2 ) has a normal M 1 and second triangle (p-i, P2, p 4 ) has a normal 11 2 , with an initial dihedral angle ⁇ 0 between normals n-i and n ⁇ .
  • the initial dihedral angle between normals n-i and ri 2 is shown on the right side of Fig. 5.
  • a bending function for the first and second triangles is typically defined with a constraint function defined by the following equation (11)
  • Another way to define the bending constraint between the first and second triangles is to specify a distance constraint between the vertices at positions p 3 and p 4 .
  • a bending constraint defined in this way is dependent on the stretching of the cloth because the distance between the vertices at positions p 3 and p 4 depends on the length of the edges incident to these vertices.
  • n 2 is defined as — — — .
  • the gradient of the constraint function is computed
  • Collisions between a cloth object and a rigid body can be handled by testing a line segment between each cloth vertex's original and new position for intersection or penetration across a boundary of the rigid body as described above in relation to line (8) of the simulation algorithm. Likewise, cases where the line segment crosses the boundary or lies entirely within the rigid body can be handled as described above. For dynamic interactions between the cloth and the rigid body, an impulse /77, ⁇ p;/ ⁇ £ can be applied to the rigid body at a contact point between a vertex "/" and the rigid body each time vertex "/" collides with the rigid body.
  • Fig. 6 illustrates one way of handling self collision in a cloth simulation.
  • a triangle defined by vertices at positions p-i, p 2 , and p 3 and having a normal n is penetrated by a vertex q.
  • FIG. 6 shows a side view of vertex q penetrating the triangle. Whenever such a penetration occurs from a direction facing the normal n, the simulation algorithm generates a constraint with the following constraint function: where h is the cloth thickness. Where vertex q enters the triangle from below, i.e., in the same direction as normal n as shown in Fig. 6, the simulation algorithm generates a constraint with the following constraint function:
  • the piece of cloth being simulated comprises a closed triangular mesh, e.g., if the piece of cloth forms a "cloth balloon,” pressure inside the mesh can be modeled by generating an equality constraint with the following constraint function:
  • constrain function (23) computes the actual volume of the closed mesh and compares it with the product of original volume V 0 and pressure stiffness /c 0 .
  • Constraint function (23) yields the following gradients, which can be used to compute position changes ⁇ p; according to equation (8):
  • V P , C ⁇ (P, x P, ) + ⁇ (P,, x P, ) + ⁇ (P, x P, ) ⁇ (24)

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Radar Systems Or Details Thereof (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Processing Or Creating Images (AREA)

Abstract

Disclosed is a method of simulating a dynamic object comprising a plurality of vertices. The method comprises defining a current position and a current velocity for a vertex 'v' among the plurality of vertices, generating an estimated next position for vertex 'v' based on the current position and current velocity, updating the estimated next position based on a plurality of constraints, and after updating the estimated next position, computing a next position and a next velocity for vertex 'v' based on the current position and estimated next position.

Description

METHOD OF SIMULATING DYNAMIC OBJECTS USING POSITION BASED
DYNAMICS
[0001] This application claims the benefit of U.S. Provisional Application No. 60/727,857 filed on October 19, 2005.
BACKGROUND OF THE INVENTION
1. Field of the Invention
[0002] Embodiments of the present invention relate generally to methods of simulating dynamic objects. More particularly, embodiments of the present invention relate to methods of simulating dynamic objects using position based dynamics.
2. Description of Related Art
[0003] Contemporary video games tend to incorporate a variety of sophisticated effects designed to mimic the behavior of objects in the real world. These effects include, for example, simulated collisions, explosions, object deformations, and so on. One recent approach that game developers have used to generate these effects is to simulate the movement and interaction of objects using the laws of physics. For example, a video game may model objects such as fluids, clothing, people, and so on, as collections of vertices that are animated by applying forces such as gravity, pressure, friction, viscosity, surface tension, mass-spring forces, and impact, to each vertex. Computational simulations that rely on the laws of physics are referred to in this written description as "physics simulations."
[0004] A virtual object that is susceptible to animation (e.g., movement or deformation) in a physics simulation is referred to in this written description as a "dynamic object." A dynamic object is typically modeled as a collection of vertices, each having a position, a mass, and a velocity. In a physics simulation, the positions and velocities of the vertices are updated over time to simulate motion. In some cases, such as a clothing simulation, the vertices may be connected together, i.e. constrained by topology. In other cases, such as fluid simulations, each vertex may be unconnected from the other vertices.
[0005] A conventional method of performing a physics simulation on a dynamic object is shown, for example, in Figure (Fig.) 1. In this written description, exemplary method steps are denoted by parentheses (XXX). Referring to Fig. 1 , the method comprises accumulating a plurality of forces at each vertex of a dynamic object (101). The method further comprises computing an acceleration for each vertex based the vertex's mass and the accumulated forces on the vertex (102). The acceleration is generally computed by Newton's second law of motion, which states that acceleration equals force divided by mass. The vertex's acceleration is then used to update the vertex's velocity (103), and finally, the vertex's new velocity is used to update its position (104). In general, steps (101) through (104) are carried out at predetermined timesteps throughout the simulation. As such, changes in a vertex's velocity and position are generally calculated by respectively integrating the vertex's acceleration and velocity over each timestep.
[0006] The method of Fig. 1 can use a variety of different numerical techniques to update the velocities and positions. For example, some common techniques include various forms of implicit or explicit integration, and finite element method or finite difference approaches.
[0007] One variation of the method illustrated in Fig. 1 uses impulses rather than forces to control vertex animation in the physics simulation. Because impulses directly impact velocities, using impulses allows velocities to be updated without performing an integration step on the accelerations. In other words, the impulses can be used instead of performing steps (101) and (102).
[0008] In designing and implementing physics simulations for video games, it is important to strike a balance between making the animations look as realistic as possible, and generating the animations fast enough to satisfy any real-time computational constraints of the games. For example, a physics simulation for an interactive video game must be fast enough and realistic enough that a user can engage in meaningful interactions the game's virtual environment without awkward delays or strange visual effects such as interpenetrating or unusually expanding or contracting objects.
[0009] In practice, it can be difficult to simultaneously achieve both the speed and realism required by physics simulations in interactive video games. For example, some techniques used to generate highly accurate physics simulations (e.g., techniques used in precision scientific applications such as molecular modeling or protein folding) are too slow for interactive video games. On the other hand, some techniques used to generate fast physics simulations rely on unstable explicit integration techniques that can lead to overshooting and energy gain problems. [0010] As an alternative to conventional methods that use forces or impulses to update the vertex positions of dynamic objects, researchers have developed position based approaches based on position based dynamics. In position based approaches, vertex positions are directly manipulated instead of being updated by integration over a predetermined timestep. Typically, the velocity of each vertex is implicitly stored by current and previous (or current and next) positions of the vertex. Two conventional examples of how the vertex positions may be manipulated include (1) moving each vertex toward a predefined goal position defined by a rest state of the dynamic object, or (2) moving each vertex to a position that satisfies a predetermined positional constraint of the vertex.
[0011] One advantage of position based approaches to dynamic object simulation is that they allow increased control over explicit integration, which prevents vertex positions from being adversely affected by numerical instability of the integration. In addition, since the vertex positions are directly manipulated, the vertices can be easily attached to kinematic objects and they can be prevented from penetrating other objects. Finally, position based approaches tend to be easy to understand, to implement, and debug.
SUMMARY OF THE INVENTION
[0012] Recognizing the many advantages of position based approaches over conventional force or impulse based approaches to dynamic object simulation, embodiments of the present invention provide several position based techniques capable of manipulating the positions of vertices in a dynamic object based on a general set of constraints. Selected embodiments of the invention also address the problem of conserving linear and angular momentum in the dynamic objects by position projection. Further, in some embodiments of the invention, vertex velocities are represented explicitly to simplify the simulation of damping and friction. [0013] According to one embodiment of the invention, a method of simulating a dynamic object comprising a plurality of vertices, is provided. The method comprises defining a current position and a current velocity for a vertex "v" among the plurality of vertices, generating an estimated next position for vertex "v" based on the current position and current velocity, updating the estimated next position based on a plurality of constraints, and after updating the estimated next position, computing a next position and a next velocity for vertex "v" based on the current position and estimated next position.
[0014] According to another embodiment of the invention, a method of updating a position of a vertex associated with a dynamic object in a dynamic object simulation is provided. The method comprises projecting the vertex onto a constraint by updating a position of the vertex along a gradient of a constraint function associated with the constraint.
[0015] According to still another embodiment of the invention, a method of performing a cloth simulation is provided. The method comprises modeling a piece of cloth as a mesh, wherein nodes of the mesh define locations of vertices of a dynamic object. The method further comprises updating a position of a vertex "v" among the vertices by projecting vertex "v" onto a bending constraint and a stretching constraint using a Gauss-Seidel type iterative procedure.
BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The invention is described below in relation to several embodiments illustrated in the accompanying drawings. Throughout the drawings like reference numbers indicate like exemplary elements, components, or steps. In the drawings: [0017] Fig. 1 shows a conventional method of simulating a dynamic object; [0018] Fig. 2 illustrates a method of simulating a dynamic object according to one embodiment of the present invention;
[0019] Fig. 3 illustrates a set of two vertices whose positions is governed by a distance constraint;
[0020] Fig. 4 illustrates a method of simulating a dynamic object according to another embodiment of the present invention;
[0021] Fig. 5 shows a piece of cloth modeled by a triangular mesh; and, [0022] Fig. 6 shows a collision involving a vertex and a simulated piece of cloth.
DESCRIPTION OF EXEMPLARY EMBODIMENTS [0023] Exemplary embodiments of the invention are described below with reference to the corresponding drawings. These embodiments are presented as teaching examples. The actual scope of the invention is defined by the claims that follow. |UU24] In general, embodiments of the present invention provide methods of simulating dynamic objects using a position-based approach. The position based- approach allows video game developers to generate realistic-looking animations while achieving the computational efficiency required for real-time interactive video games.
[0025] Although several embodiments of the invention are particularly suited to video games, embodiments of the invention can also be adapted for use in other application areas such as computer graphics, scientific modeling, computer generated imagery, and so on.
[0026] Embodiments of the invention can be implemented in any of a variety of software configurations, or on any of a variety of computing platforms. For example, a dynamic object simulation can be run as a single application on a general purpose central processing unit (CPU), or as a secondary application running in parallel with a main application. Where the dynamic object simulation is run as a secondary application, the secondary application may run on the same processor as the main application, or on another processor such as a physics processing unit, or another CPU. Several different software and hardware configurations for running a dynamic object simulation according to various embodiments of the present invention are disclosed, for example, in U.S. Patent Applications with serial numbers 10/715,459, 10/815,721, and 10/982,791.
[0027] In selected embodiments of the invention, a dynamic object is modeled by a set of vertices, where each vertex is characterized by a position in a three dimensional (3D) virtual space, a velocity, and a mass. The position of each vertex is governed by a corresponding set of constraints such that when the dynamic object is simulated, the position of each vertex is updated in accordance with the constraints. Since a vertex's velocity is related to its change in position, each vertex's velocity is generally updated along with its position. [0028] Fig. 2 shows a simple example of how a dynamic object may be simulated according to one embodiment of the invention. Referring to Fig. 2, a method of simulating a dynamic object comprises initializing a set of vertex parameters corresponding to a set of vertices of the dynamic object (201). The vertex parameters comprise a vertex position, a velocity, and a mass for each of the vertices. The method further comprises projecting the vertices onto the constraints to generate new vertex positions and velocities (202), and then replacing current vertex positions and velocities with the new vertex positions and velocities (203). The simulation then proceeds by repeating steps (202) and (203). [0029] Within the context of a position-based dynamic object simulation, the term "constraint" refers broadly to any set of mathematical, geometrical, or algorithmic relationships used to determine a vertex's position. For instance, a constraint may define a desired distance or distance range between the positions of two vertices within the same dynamic object. Such a constraint is referred to as a "distance constraint." Where the actual distance between the two vertices is the same as the desired distance or is within the desired distance range, the vertices are said to "satisfy" the distance constraint. Similarly, whenever the relationship defined by any type of constraint is true with respect to a particular vertex or vertex position, the vertex or vertex position is considered to "satisfy" the constraint. In step (202) of Fig. 2, the vertices are "projected" onto the constraints by moving the vertices to new positions such that the vertices either satisfy or at least approximate the constraints. [0030] In equation form, the process of projecting a vertex onto a constraint can be described as follows. Let C(p) = f(p) represent a constraint function for the positions "p" of a set of vertices. The vertices are projected onto a constraint with constraint function "C(p)" by determining some position changes "Δp" such that C(p+Δp) = 0. For instance, Fig. 3 shows a set of two (2) vertices with positions p-i and p2 which are governed by a distance constraint with the following constraint function: C(pi, p2) = IP1-P2I - d, where d is the desired distance between vertices pi and P2. The distance constraint with constraint function C(p-ι, p2) is satisfied by modifying positions P1 and p2 by Δpi and Δp2 such that C(p-ι+Δpi, p2+Δp2) = 0. A more detailed description of how position changes Δp may be calculated is presented later in this written description.
[0031] In addition to distance constraints, vertex positions may also be governed by collision constraints, attachment constraints, linear momentum constraints, and angular momentum constraints, to name but a few.
[0032] In general, collision constraints define boundaries for a vertex's motion. For example, the collision constraints may define limits at which a vertex will collide with another object or surface in the dynamic object simulation. A vertex is considered to satisfy a particular collision constraint whenever the vertex's position does not extend beyond the boundaries defined by the collision constraint. [0033] An attachment constraint requires a first vertex's position to be linked with a second vertex's position within the simulation. Based on the linking, whenever the position of the first vertex changes, the position of the second vertex also changes, or vice versa. Accordingly, attachment constraints can be used, for example, to bind the motion of one dynamic object to the motion of another dynamic object or a static object in a simulation. A simple way to implement an attachment constraint is to simply set a vertex's position to a static target position, or update the vertex's position at every timestep to coincide with the position to a target position on a kinematic object. To prevent other constraints related to the vertex from influencing the vertex's position, the inverse mass of the vertex can be set to zero. [0034] Linear and angular momentum constraints require that changes in vertex positions due to the internal constraints of a dynamic object conserve linear and angular momentum of the object. The term "internal constraints" here denotes constraints related entirely to components (e.g., vertices) within the dynamic object. For instance, distance constraints are generally considered to be internal constraints since they typically only involve vertices within the same dynamic object. In contrast, collision and attachment constraints are external constraints because they relate to external boundaries and objects.
[0035] In general, linear and angular momentum constraints take into account changed positions for all vertices in a dynamic object. For instance, a linear momentum constraint for a dynamic object including several vertices is satisfied when the vertices change positions such that the following relationship (1) is true:
∑ W1Ap1 = O . (1)
In relationship (1), m, denotes the mass of the /* vertex of the dynamic object, and Δp,- denotes a change in the /* vertex's position. Another way of stating relationship (1) is that the dynamic object's center of mass must stay the same after its vertex positions change in order for the dynamic object's linear momentum constraint to be satisfied. Similarly, the angular momentum constraint for the dynamic object is satisfied when the vertices change positions such that the following relationship (2) is true:
Figure imgf000009_0001
In relationship (2), r, denotes a distance from the /* vertex to an arbitrary center of rotation for the dynamic object.
[0036] Whenever the changes in vertex positions due to internal constraints fail to satisfy the linear and/or angular momentum constraints, the dynamic object will behave as though acted on by "ghost" external forces. These "ghost" external forces will cause the object's center of mass to change and/or its vertices to rotate about the center of rotation.
[0037] Throughout a dynamic object simulation, most of the constraints governing a dynamic object's vertex positions tend to stay the same. For instance, distance constraints generally do not change. However, an object's collision constraints generally vary based on the object's movement, and based on the movement of other objects in its environment.
[0038] According to selected embodiments of the invention, new positions for the vertices of a deformable object can be generated by first predicting the new positions and then using the constraints to modify the predicted new positions. Fig. 4 illustrates a method of simulating a dynamic object wherein predicted vertex positions are used to generate new vertex positions.
[0039] Referring to Fig. 4, the method comprises initializing a set of vertex parameters for a deformable object (401). The vertex parameters include a position, mass, and velocity for each vertex associated with the deformable object. The method further comprises computing new positions for the vertices based on their respective current velocities (402). The new positions are then modified based on constraints associated with the vertices (403). Next, the vertex velocities are updated with the respective differences between the modified new positions and their corresponding current vertex positions, divided by a timestep (404). Finally, the vertex positions are updated with the respective modified new position estimates (405).
[0040] The following exemplary simulation algorithm illustrates one way of implementing the method illustrated in Fig. 4. In the simulation algorithm, a dynamic object is represented by a set of "ΛT vertices and "M" positional constraints. In addition, the object's motion is also governed by Mn collision constraints. Among the vertices, each vertex / e [l,...,N] has a mass mu a position xh and a velocity V1. Among the constraints, each constraint j e [1,...,M] includes a cardinality nb a function C, : Fϊ3nj -> R, a set of indices {/i,.../,,,}, /fe e[1 ,...Λ/], a stiffness parameter /c; e[0...1], and a type of either "inequality" or "equality". A constraint/ with type "equality" is satisfied if C J,(x, I x, nj ) = 0 , and a constraint; with type "inequality" is satisfied if C Ax. ,...,x, ) > 0. The stiffness parameter k, defines the strength of the constraint in a range from zero to one. The simulation algorithm is defined as follows:
(1) for all vertices /
(2) initialize x, = x°. , V1 = V,°, W, = 1 / 7«,
(3) endfor
(4) loop
(5) forall vertices / do v, 4- v, + AtWf01 (X1)
(6) damp velocities ' (V-I , ... ,VW)
(7) forall vertices / do p( <— x, + AtV1
(8) forall vertices / do generateCollisionConstraints (x, -> p,)
(9) loop solverlterations times
(10) projectConstraints (Cλ,...,CM+M^ , pi,... p2)
(11) endloop
(12) forall vertices /
(13) v, <- (P, -x, ,)/At
(14) x, <-p,
(15) endfor
(16) velocityUpdate (V1 V5 V,,)
(17) endloop
[0041] In the simulation algorithm, lines (1)-(3), (7), (9)-(11), and (12)-(15) correspond to respective steps (401), (402), (403), and (404)-(405) in Fig. 4. Lines (1)-(3) initialize the positions, velocities, and masses of the vertices. Line (5) computes an estimated velocity for each vertex based on the vertex's current velocity and any external forces acting on the dynamic object at the vertex's position. Line (7) computes an new position "p" for each vertex "/" in the dynamic object based on the vertex's current position X/ and velocity estimate. Lines (9)-(11) modify new positions "p" by projecting the constraints onto the new positions, and then lines (12)-(15) update vertex positions x, and velocities v, based on the modified new positions.
[0042] In lines (5) and (7), velocity estimates and new position estimates p, are computed using an explicit Euler integration step with a timestep Δt. Line (5) takes external forces fext(χ') that cannot be converted into positional constraints and uses them to compute the velocity estimates. For example, line (5) generally includes gravity as an external force, so that line (5) becomes v, <- v, + Atg , where "g" stands for acceleration due to gravity.
[0043] Of the remaining lines in the simulation algorithm, line (6) executes a velocity damping operation on the estimated velocities, line (8) generates the Mcoιι collision constraints, and line (16) uses friction and restitution coefficients to modify the velocities of any vertices affected by collisions.
[0044] Lines (9)-(11) use an iterative process to modify new positions "p" so that they satisfy the "M" positional constraints and the "M00Ii" collision constraints. One way to implement the iterative process is with Gauss-Seidel-type iteration. The
Gauss-Seidel type iteration loops through the M + Mcoιι constraints, and with each loop, it projects each vertex of the dynamic object onto a new location satisfying a single one of the constraints. In the Gauss-Seidel type iteration, the new vertex locations immediately become available to the iterative process, thus speeding up convergence.
[0045] The new positions produced by the iterative process and applied to the dynamic object in lines (13) and (14) will never cause the vertices of the dynamic object to overshoot their equilibrium positions, and hence the simulation method defined by the algorithm is unconditionally stable.
[0046] In the iterative process, the vertices are projected onto the constraints in such a way that the linear and angular momentum of the dynamic object are conserved with respect to the internal constraints. An illustration of how this can be done follows.
[0047] Suppose we have a constraint "C" on positions pi,... ,pn with a cardinality n and stiffness k. We let p be the concatenation [tf ,...p- T nf . Where C is an internal constraint, it is independent of the rigid body modes of the dynamic object, i.e., translation and rotation. This means that rotating or translating the dynamic object does not change the function value of the constraint for each vertex. The gradient VpC is perpendicular to the rigid body modes because it is the direction of maximal change. If the position changes Δp are chosen to be along VpC , linear and angular momenta are automatically conserved if all vertices have the same mass. We can derive a method for computing the position changes Δp when all vertices have the same mass as follows. [0048] We want to find position changes Δp such that C(p + Δp) = 0. This equation can be approximated by the following equation (3): C(p + Δp) « C(P) + VpC(p) -Δp = 0 (3)
If Δp is restricted to be in the direction of VpC , then there is some scalar λ such that the following equation (4) is true:
Δp = AVpC(p) . (4)
By substituting equation (4) into equation (3), solving for λ, and then substituting the value for λ into equation (4), the following equation (5) can be derived for Δp:
Figure imgf000013_0001
Equation (5) defines a regular Newton-Raphson step for the iterative solution of a non-linear equation.
[0049] Based on the foregoing, the position change Δpi for an individual point pi can be computed by the following equation (6):
Δp/ = -sVPiC(p1,...,pB) (6) where the same scaling factor "s" is defined for all vertices by the following equation
(7):
Figure imgf000013_0002
Where each of the / vertices in the dynamic object has a different mass rrii, the position change Δpi of each vertex "/" is weighted proportional to their inverse masses as in the following equation (8):
Figure imgf000013_0003
[0050] As an example of how the position changes can be computed, consider the constraint function C(pi, p2) = |pi — p2| — d illustrated in Fig. 3. The derivatives of the constraint function with respect to positions pi and p2 are VP] C(p] 5p2) = n and
Vn C(p1 ;p2) = - n , respectively, with n = . Scaling factor "s" is therefore
Figure imgf000013_0004
and thus position changes Ap1 and Δp2 are computed according to
Figure imgf000014_0001
the following equations (9) and (10):
Figure imgf000014_0002
[0051] Since constraints of the type "inequality" are satisfied as long as the constraint function C(pl v..,pn) > 0 , vertices are only projected onto an inequality constraint during the iterative process if the constraint's constraint function
C(P1, ...,pn) < 0. In contrast, constraints of the type "equality" are only satisfied when the constraint function C(p15...,p,,) = 0 and therefore, vertices tend to always be projected onto the equality constraints.
[0052] There are many ways to incorporate stiffness parameter "k" into the dynamic object simulation. One way is to simply multiply each of position changes Δp by k. However, if k is incorporated in this way for multiple loops of the iterative process, the difference between Δp with and without stiffness parameter "k" will depend non-linearly based on the number of loops that are performed. In equation form, if ns loops of the iterative process are performed, the difference between Δp with and without stiffness parameter "/c" will be Ap(I- k)"' . In practice, it is desirable to be able to adjust position changes Δp according to a linear relationship with stiffness parameter k and independent of the number of loops of the iterative process. One way to form such a linear relationship is by multiplying each position change by k' instead of k, where the value of k' is defined by the following equation: k' = 1 - (1 - k)1'"' . By substituting k' for k, the difference between Δp with and without stiffness parameter "/c" becomes Ap(I- k')"° - Ap(I- k) , which is a linear relationship in k.
[0053] Line (8) of the simulation algorithm generates collision constraints for the dynamic object simulation. The number of collision constraints that are generated in each timestep varies according to the number of vertices that collide with other objects in the simulation. Colliding vertices are detected by testing each vertex "/" of the dynamic object to see whether a line segment between original position Xι and new position p, enters another object. If the line segment enters a second object, the algorithm computes an entry point qc and a surface normal nc of the second object at entry point qc. Then, the simulation algorithm generates an inequality constraint with constraint function C(p) = (p - qc) nc and stiffness k = 1 and the inequality constraint is subsequently used to generate the modified new positions. On the other hand, if the line segment lies entirely inside another object, the collision detection has failed at some point. This problem can be addresses by computing a surface point qs of the other object that is closest to new position p,, and the surface normal ns of the other object at surface point qs. The simulation algorithm then generates an inequality constraint with constraint function C(p) = (p - qs) ns and stiffness k = 1 , and the inequality constraint is subsequently used to generate the modified new positions.
[0054] Line (16) of the simulation algorithm handles friction and restitution for the collisions by damping the velocity of each colliding vertex in a direction perpendicular to surface normal nc or ns and reflecting the velocity of each colliding vertex in a direction toward surface normal nc or ns.
[0055] Collisions between the dynamic object and other dynamic objects (as opposed to collisions between the dynamic object and static objects) can be handled by inputting N vertices and M constraints corresponding to all of the objects into the simulation algorithm. Then, when any vertex with position p0 in one of the objects passes through the plane of a triangle defined by vertices with respective positions Pi, p2, and p3 of another one of the objects, the simulation algorithm generates a constraint with constraint function C(P0-P1-P29P3) = ±(p0 -P1H(P2 -P1) X (P3 -P1)] , which keeps the vertex with position po on the correct side of the triangle. This constraint function is independent of the rigid body modes of the objects, and therefore it will conserve the objects' linear and angular momentum. Although the plane of a triangle is used to test for collisions in this example, collisions can be defined in relation to other surfaces of simulated objects, including, for example, the plane of an arbitrary polygon or a curved surface.
[0056] Line (6) of the simulation algorithm damps the velocities of each of the N vertices. The following damping subroutine illustrates one way to perform the damping:
Figure imgf000015_0001
(2) vCffl
Figure imgf000016_0001
(3) L = X1 F1 X (M1V1 )
(4) I = ∑,ϊftr W|
(5) O) = T1L forall vertices /
(7) Δv, = ycm + ω x γ, - y,
(8) Vj ^- v. + ^^Δv, endfor
In the damping subroutine, r, = x, -xcm , i- is a 3 x 3 matrix with the property that rjv = r, x v , and kdampmg e [O...l] is a damping coefficient. Lines (1) through (5) of the damping subroutine compute a global linear velocity xcm and angular velocity ω for the dynamic object. Lines (6) through (9) of the damping subroutine damp individual deviations Δv, from the global motion vcm + ω * r,-. Where the damping coefficient is set to kdampmg = 1 , only the global motion survives and the N vertices behave like a rigid body. For arbitrary values of kdampmg, the velocities are globally dampened but without influencing the global motion of the vertices.
[0057] Selected embodiments of the invention can be used to simulate cloth. For example, a piece of cloth can be represented as a triangular mesh wherein each node of the mesh represents a vertex of a simulated dynamic object. The triangular mesh has a density p defined in mass per area (e.g., kg/m2), and the mass of each vertex is set to the sum of one third of the area of each adjacent triangle times p. Although this example uses a triangular mesh, those skilled in the art will understand that various different mesh topologies can be used to perform the cloth simulation. [0058] Each edge of the triangular mesh has a stretching constraint with a constraint function QH.ete/;(p1,p2) = P1 -P2 -Z0 , a stretching stiffness kstretch, and type
"equality." In the stretching constraint, a scalar /0 is an initial length of the edge and stretching stiffness kstretch is a global constraint typically defined by a user and defining a stretching stiffness of the piece of cloth. In addition, each pair of adjacent triangles in the mesh has a bending constraint, which is explained below with reference to Fig. 5. [0059] Fig. 5 shows a piece of cloth modeled by a triangular mesh including first and second triangles (P1, p3, p2) and (pi, P2, P4), where pi through p4 are the positions of respective first through fourth vertices of the mesh. First triangle (P1, p3, P2) has a normal M1 and second triangle (p-i, P2, p4) has a normal 112, with an initial dihedral angle φ0 between normals n-i and n∑. The initial dihedral angle between normals n-i and ri2 is shown on the right side of Fig. 5. A bending function for the first and second triangles is typically defined with a constraint function defined by the following equation (11)
(1 1 )
Figure imgf000017_0001
a bending stiffness kbend, and type "equality."
[0060] Another way to define the bending constraint between the first and second triangles is to specify a distance constraint between the vertices at positions p3 and p4. However, a bending constraint defined in this way is dependent on the stretching of the cloth because the distance between the vertices at positions p3 and p4 depends on the length of the edges incident to these vertices.
[0061] Vertices can be projected onto the stretching constraint using equations
(9) and (10). On the other hand, vertices are generally projected onto the bending constraints by a slightly more complicated procedure such as the following.
[0062] First, position p-i is set to zero so that equation (11) becomes
Cw(Pi>P2>P3>P4) = Ωr cos(ni - Hi)-Po ' where normal U1 is defined as 2 >< P3 and p2 x p3
normal n2 is defined as — — — . The gradient of the constraint function is computed
P2 X p4 with respect to the positions of the first through fourth vertices as follows:
1 Sn1
VP3 C n2) , (12) r Sp3
1 Sn2
VP,C «l ) . (13) δp4
1 Sn1 Sn2
VP2 C n2 +ni and (14)
Sp2 Sp2
Vp,C — vp c- VP3 C - " V,C (15) wherein, d=(n1 dot n2). Next, using gradients of normalized cross products, the following components of a projection equation are computed:
P2 x n2 + (H1 x p2)t/ q3 = (Ib)
P2 χ P3
P2 x n, + (H2 X p2)J
Q4 = (17)
P2 X P4
P3 X n2 H- (H1 X p3)J P4 X n1 H- (D2 X p4)./
Q2 = - (18) p2 x p3 p2 x p4
Figure imgf000018_0001
Finally, the position changes for the first through fourth vertices can be computed according to the following projection equation (20):
Δ
Figure imgf000018_0002
[0063] Collisions between a cloth object and a rigid body can be handled by testing a line segment between each cloth vertex's original and new position for intersection or penetration across a boundary of the rigid body as described above in relation to line (8) of the simulation algorithm. Likewise, cases where the line segment crosses the boundary or lies entirely within the rigid body can be handled as described above. For dynamic interactions between the cloth and the rigid body, an impulse /77,Δp;/Δ£ can be applied to the rigid body at a contact point between a vertex "/" and the rigid body each time vertex "/" collides with the rigid body. [0064] In practice, the triangles defined by the vertices of a simulated piece of cloth may be so large that a rigid body may penetrate the cloth without colliding with any of the cloth's vertices. To address this problem, convex corners of rigid bodies may also be tested for collisions with the cloth triangles. [0065] Another problem to be addressed in a cloth simulation is collisions between different parts of the cloth, also called "self-collision." Fig. 6 illustrates one way of handling self collision in a cloth simulation. In Fig. 6, a triangle defined by vertices at positions p-i, p2, and p3 and having a normal n is penetrated by a vertex q. The right side of Fig. 6 shows a side view of vertex q penetrating the triangle. Whenever such a penetration occurs from a direction facing the normal n, the simulation algorithm generates a constraint with the following constraint function:
Figure imgf000019_0001
where h is the cloth thickness. Where vertex q enters the triangle from below, i.e., in the same direction as normal n as shown in Fig. 6, the simulation algorithm generates a constraint with the following constraint function:
<****>«-*>£$£-%-»■ «
Projecting vertex q onto the constraints associated with constraint functions (21) or
(22) tends to keep vertex q on the correct side of the triangle while conserving the cloth's linear and angular momentum.
[0066] Where the piece of cloth being simulated comprises a closed triangular mesh, e.g., if the piece of cloth forms a "cloth balloon," pressure inside the mesh can be modeled by generating an equality constraint with the following constraint function:
C(Pi, ...,P^) = ∑(P,; X P,. ) - P4 - k piesswe V 0 * (23) i=l and a stiffness /c=1. In constraint function (23), t[ , t2' , and t3' are the three indices of the vertices belonging to each triangle "/," and pr, , p(1 , and p/; are the respective positions of those three vertices. V0 represents an original volume of the closed mesh, and kpresSure represents a pressure stiffness which determines how much the volume of the closed mesh is allowed to deviate from the original volume. The sum in constrain function (23) computes the actual volume of the closed mesh and compares it with the product of original volume V0 and pressure stiffness /c0. Constraint function (23) yields the following gradients, which can be used to compute position changes Δp; according to equation (8):
V P, C = ∑ (P, x P, ) + ∑ (P,, x P, ) + ∑ (P, x P, ) ■ (24)
;'/=' J 'H i H->
[0067] The foregoing preferred embodiments are teaching examples. Those of ordinary skill in the art will understand that various changes in form and details may be made to the exemplary embodiments without departing from the scope of the present invention as defined by the following claims.

Claims

What is claimed:
1. A method of simulating a dynamic object comprising a plurality of vertices, the method comprising: defining a current position and a current velocity for a vertex "v" among the plurality of vertices; generating an estimated next position for vertex "v" based on the current position and current velocity; updating the estimated next position based on a plurality of constraints; and, after updating the estimated next position, computing a next position and a next velocity for vertex "v" based on the current position and estimated next position.
2. The method of claim 1 , further comprising: before generating the estimated next position, updating the current velocity in accordance with external forces acting on the dynamic object; and, damping the updated current velocity.
3. The method of claim 1 , wherein the plurality of constraints comprise collision constraints, and the method further comprises: generating the collision constraints before updating the estimated next position; and, updating the next velocity based on the collision constraints.
4. The method of claim 3, wherein generating the collision constraints comprises: detecting whether a line segment between the current position and the estimated next position intersects a boundary of a simulated object; upon detecting that the line segment intersects the boundary, determining a location qc of the intersection and a surface normal nc of the simulated object at location qc; and, defining a collision constraint on a position "p" of vertex "v" with a constraint function C(p)=(p-qc)-nc.
5. The method of claim 3, wherein generating the collision constraints comprises: detecting whether a line segment between the current position and the estimated next position lies entirely within a boundary of a simulated object; upon detecting that the line segment lies entirely within the boundary, determining a location qs of a point on the boundary closest to the estimated next position and a surface normal ns of the simulated object at location qs; and, defining a collision constraint on a position "p" of vertex "v" with a constraint function C(p)=(p-qs)-ns.
6. The method of claim 4, further comprising: damping the velocity of vertex "v" in a direction perpendicular to surface normal nc; and, reflecting the velocity of vertex "v" in the direction of surface normal nc.
7. The method of claim 5, further comprising: damping the velocity of vertex "v" in a direction perpendicular to surface normal ns; and, reflecting the velocity of vertex "v" in the direction of surface normal ns.
8. The method of claim 1, wherein updating the estimated next position based on the plurality of constraints comprises: projecting vertex "v" onto the plurality of constraints using Gauss-Seidel type iteration.
9. The method of claim 1 , wherein the plurality of constraints comprise internal and external constraints; and, wherein updating the estimated next position based on the plurality of constraints comprises: projecting vertex "v" onto the internal and external constraints such that linear and angular momentum of the dynamic object due to projection onto the internal constraints is conserved.
10. The method of claim 1 , wherein updating the estimated next position based on a plurality of constraints comprises: projecting a vertex "v" onto a constraint by computing a gradient of a constraint function associated with the constraint, and updating the position of vertex "v" along the gradient.
11. The method of claim 2, wherein damping the updated current velocity comprises: computing a global linear velocity and a global angular velocity for the dynamic object; and, reducing deviation between the updated current velocity and the global linear and angular velocities.
12. The method of claim 1 , wherein the plurality of constraints comprises at least one of a distance constraint, an attachment constraint, a collision constraint, a bending constraint, and a stretching constraint.
13. A method of updating a position of a vertex associated with a dynamic object in a dynamic object simulation, the method comprising: projecting the vertex onto a constraint by updating a position of the vertex along a gradient of a constraint function associated with the constraint.
14. The method of claim 13, wherein the constraint comprises a distance constraint, an attachment constraint, a collision constraint, a bending constraint, or a stretching constraint.
15. The method of claim 13, wherein updating the position of the vertex along the gradient comprises: updating the position using a regular Newton-Raphson step.
16. A method of performing a cloth simulation, the method comprising: modeling a piece of cloth as a mesh, wherein nodes of the mesh define locations of vertices of a dynamic object; updating a position of a vertex "v" among the vertices by projecting vertex "v" onto a bending constraint and a stretching constraint using a Gauss-Seidel type iterative procedure.
17. The method of claim 16, wherein the mesh is a triangular mesh; wherein the bending constraint determines a dihedral angle between surface normals of adjacent triangles in the triangular mesh; and, wherein the stretching constraint determines a distance between adjacent vertices in the triangular mesh.
18. The method of claim 16, further comprising: detecting a collision between the piece of cloth and a rigid body; and, applying an impulse to the rigid body at a contact point between the rigid body and the piece of cloth.
19. The method of claim 16, further comprising: detecting a collision between a first part of the piece of cloth and a second part of the piece of cloth; and, projecting a vertex of the first part onto a constraint adapted to prevent the vertex from penetrating the second part, wherein projecting the vertex onto the constraint conserves linear and angular momentum of the piece of cloth.
20. The method of claim 16, wherein the mesh is a closed triangular mesh and the method further comprises: projecting all vertices of the dynamic object onto a constraint function adapted to maintain the volume of the closed triangular mesh.
PCT/US2006/036514 2006-03-07 2006-09-19 Method of simulating dynamic objects using position based dynamics WO2007102845A2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US11/368,407 US7616204B2 (en) 2005-10-19 2006-03-07 Method of simulating dynamic objects using position based dynamics
US11/368,407 2006-03-07

Publications (2)

Publication Number Publication Date
WO2007102845A2 true WO2007102845A2 (en) 2007-09-13
WO2007102845A3 WO2007102845A3 (en) 2007-11-01

Family

ID=38475292

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2006/036514 WO2007102845A2 (en) 2006-03-07 2006-09-19 Method of simulating dynamic objects using position based dynamics

Country Status (1)

Country Link
WO (1) WO2007102845A2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114565705A (en) * 2022-02-28 2022-05-31 百果园技术(新加坡)有限公司 Virtual character simulation and live broadcast method, device, equipment and storage medium
CN118780097A (en) * 2024-09-12 2024-10-15 山东大学 A method and system for interactive simulation of fluid and thin film solid

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6888549B2 (en) * 2001-03-21 2005-05-03 Stanford University Method, apparatus and computer program for capturing motion of a cartoon and retargetting the motion to another object
US7363199B2 (en) * 2001-04-25 2008-04-22 Telekinesys Research Limited Method and apparatus for simulating soft object movement
US6970171B2 (en) * 2001-05-10 2005-11-29 Pixar Global intersection analysis for determining intesections of objects in computer animation
US7079145B2 (en) * 2004-01-22 2006-07-18 Ageia Technologies, Inc. Method and program solving LCPs for rigid body dynamics

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114565705A (en) * 2022-02-28 2022-05-31 百果园技术(新加坡)有限公司 Virtual character simulation and live broadcast method, device, equipment and storage medium
CN118780097A (en) * 2024-09-12 2024-10-15 山东大学 A method and system for interactive simulation of fluid and thin film solid

Also Published As

Publication number Publication date
WO2007102845A3 (en) 2007-11-01

Similar Documents

Publication Publication Date Title
US7616204B2 (en) Method of simulating dynamic objects using position based dynamics
Müller et al. Position based dynamics
Meyer et al. Interactive animation of cloth‐like objects in virtual reality
US7650266B2 (en) Method of simulating deformable object using geometrically motivated model
Volino et al. Developing simulation techniques for an interactive clothing system
Barbič et al. Six-dof haptic rendering of contact between geometrically complex reduced deformable models
US7363199B2 (en) Method and apparatus for simulating soft object movement
Heidelberger et al. Consistent penetration depth estimation for deformable collision response.
Desbrun et al. Interactive animation of structured deformable objects
US7091977B2 (en) Animation method of deformable objects using an oriented material point and generalized spring model
Essa et al. Physically-based modeling for graphics and vision
CN104318601B (en) Human body movement simulating method under a kind of fluid environment
WO2007102845A2 (en) Method of simulating dynamic objects using position based dynamics
Desbrun et al. Interactive animation of cloth-like objects for virtual reality
Bar-Lev et al. Virtual marionettes: a system and paradigm for real-time 3D animation
Kharevych et al. 3D physics engine for elastic and deformable bodies
Tournier et al. Velocity-based adaptivity of deformable models
Di Giacomo et al. Bi-layered Mass-Spring Model for Fast Deformations of Flexible Linear Bodies.
Mendoza et al. Position Based Dynamics
Meyer et al. SELF INTERSECTION WITH CULLIDE
Vezzaro et al. Interactive constrained dynamics for rigid and deformable objects
Teschner et al. Interacting Deformable Objects
Garg et al. Haptic rendering of thin and soft objects
Jones Artist-guided physics-based animation
Mahal et al. A pseudo-immersive virtual environment—a framework for modelling sheet deformation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 06803866

Country of ref document: EP

Kind code of ref document: A2