2018 Introduction To Pba
2018 Introduction To Pba
Adam W. Bargteil is an assistant professor in the Computer Science and Electrical Engineering
department at the University of Maryland, Baltimore County. His primary research interests lie in
physics-based animation, an area he has worked in since 2001. His work spans a wide range of
phenomena including rigid bodies, soft bodies, and fluids. He earned his Ph.D. in computer science
from the University of California, Berkeley and spent two years as a postdoctoral fellow in the
School of Computer Science at Carnegie Mellon University. From 2005 to 2007, he was a consultant
at PDI/DreamWorks, developing fluid simulation tools that were used in "Shrek the Third" and
"Bee Movie." He has offered full semester graduate courses on physics-based animation five times
Authors’ addresses: Adam W. Bargteil, [email protected], University of Maryland, Baltimore County, Baltimore, United
States; Tamar Shinar, [email protected], University of California, Riverside, Riverside, United States.
Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee
provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and
the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses,
contact the owner/author(s).
SIGGRAPH ’18 Courses, August 12-16, 2018, Vancouver, BC, Canada
© 2018 Copyright held by the owner/author(s).
ACM ISBN 978-1-4503-5809-5/18/08.
https://doi.org/10.1145/3214834.3214849
1
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
and has twice taught an undergraduate course on computer animation, about half of which focuses
on physics-based animation.
Tamar Shinar is an assistant professor of Computer Science and Engineering at the University of
California, Riverside, where she co-leads the Riverside Graphics Lab. She completed her Ph.D. at
Stanford University in 2008, where she developed techniques for physics-based animation of solids,
fluids, and solid-fluid coupling. She was a postdoctoral fellow at the Courant Institute at NYU,
where she developed mathematical and computational models of cell biomechanics. Her research
interests center on physics-based animation, with a particular focus on solid-fluid coupling. At UCR,
she teaches courses on computer graphics, scientific computing, and physics-based animation.
2
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
SCHEDULE
3
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
second-order ordinary differential equations and advocate for the symplectic Euler method, despite
its lower order of accuracy. We then turn to implicit integration, which couples together a system
of partial differential equations. We then derive the linearly implicit Euler method by explicitly
linearizing the equations of motion for elastic bodies (avoiding the need for Taylor expansion).
Then we briefly discuss alternatives for solving the resulting linear system and the underlying
nonlinear system.
Constraints. In our final section, we discuss the use of constraints in physics-based animation.
We discuss the difference between bilateral (equality) and unilateral (inequality) constraints and
the resulting implications. We also discuss the difference between soft and hard constraints and
the enforcement of constraints through penalty forces, Lagrange multipliers, and generalized
coordinates. We then discuss how constraints are enforced in practical constrained rigid body
systems. Finally, we discuss one of the most difficult constraint problems in computer animation:
non-penetration constraints that result from collision and contact.
4
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
5
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
is decreased the approximation in Equation (3) becomes more accurate, resulting in a better solution
to the initial value problem. However, that better solution comes at the cost of longer computation
time as a larger number of timesteps are required to cover the same amount of simulated time.
1 While it is conceptually convenient to imagine a Particle structure, many practical implementations do not store all a
particle’s data contiguously. Instead, a ParticleSystem will store multiple single-datum arrays (i.e. separate arrays for
positions, velocities, and force accumulators). Doing so increases efficiency because it avoids loading unnecessary data into
the cache. For example, a particle’s position is not needed to zero out its force accumulator.
6
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
7
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
2 MATHEMATICAL MODELS
In this section we introduce the mathematical models that govern motion. This field of study is
often referred to as Continuum Mechanics because the models assume that the underlying materials
are continuous, which is a reasonable assumption at the scales and for the phenomena we are
generally concerned with. In the following sections we will discuss how numerical methods are
employed to discretize these models to obtain computational solutions.
2.1.1 Newton’s Laws of Motion. Newton’s laws describe the dynamics of a body that can be
idealized as a particle, or point mass. Newton used these laws to study many systems, including the
motion of planets over large distances. While Newton’s laws do not address the extent of the body,
the distribution of its mass, and its internal forces, they can be applied to systems such as soft bodies
or fluids by viewing these as collections of particles and characterizing all of the inter-particle
forces.
Newton’s first law. Newton’s first law states that a body remains at rest or moves with a
constant velocity unless acted upon by a force. This is also called the law of inertia and the motion
described is called uniform motion.
Newton’s second law. Newton’s second law is fundamental in computing the evolution in time
of the state of a body. Newton’s famous second law, 𝐟 = 𝑚𝐚, states that the instantaneous change
8
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
in the momentum of a body is equal to the net force acting on the body. The momentum of a body
is given by
𝐩(𝑡) = 𝑚𝐯(𝑡), (16)
where 𝑚 is the mass of the body and 𝐯 is the velocity of the body. The mathematical expression of
Newton’s second law is
𝑑 𝑑
𝐟(𝑡) =𝐩(𝑡) = 𝑚 𝐯(𝑡) = 𝑚𝐚(𝑡). (17)
𝑑𝑡 𝑑𝑡
Therefore, application of Newton’s second law to a physical system is done by identifying all of
the bodies in the system and identifying the forces acting on each body. For example, in Figure 1,
Fig. 1. A particle of mass 𝑚 is subject to a spring force 𝐟 𝑠 , a graviational force 𝐟 𝑔 , and an unspecified
external force 𝐟 𝑒 . Given the forces, Newton’s second law gives the acceleration of the particle, which is
then used to compute a new velocity and position of the particle.
a particle of mass 𝑚 experiences a spring force 𝐟 𝑠 from a neighboring particle, the gravitational
force 𝐟 𝑔 , and another unspecified external force 𝐟 𝑒 . By Newton’s second law, the acceleration of
the particle is given by
𝑚𝐚 = 𝐟 𝑠 + 𝐟 𝑔 + 𝐟 𝑒 . (18)
Given the forces, the acceleration is used to update the velocity of the body, and the velocity is
used to update the position of body.
Newton’s third law. Newton’s third law states that for every action, there is an equal and
opposite reaction. Specifically, in an interaction between two particles or bodies, if body A applies
force 𝐟 to body B, then body B applies force −𝐟 to body A. We can use this law to help identify all
of the forces acting on the bodies in a given scenario. For example, in the image below, a particle of
mass 𝑚1 is connected by spring to a particle of mass 𝑚2 . If the spring force experienced by the
particle of mass 𝑚1 is 𝐟 , then Newton’s third law requires that the spring force experienced by the
particle of mass 𝑚2 is −𝐟 . Note that by Newton’s second law, if their masses are unequal, then their
accelerations due to the spring force will necessarily be unequal. In particular, the lighter particle
will experience a larger acceleration, while the heavier particle experiences a smaller acceleration.
Consider another example, illustrated below, where a particle of mass 𝑚 is resting on the ground.
The particle exerts a force on the ground equal to 𝐟 = −𝑚𝐠. By Newton’s third law, the ground
9
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
exerts a reaction force on the particle equal to −𝐟 = 𝑚𝐠. Therefore, forces acting on the particle are
the force of gravity −𝑚𝐠 and the reaction force from the ground 𝑚𝐠. By Newton’s second law,
𝑚𝐚 = −𝑚𝐠 + 𝑚𝐠 = 𝟎, (19)
so that the particle remains at rest on the ground.
Finally, consider an example where a moving particle of mass 𝑚1 collides with a moving particle
of mass 𝑚2 , illustrated below. Due to the collision, each particle feels a force, such that after the
collision the relative velocity of the particles is at least zero to prevent their interpenetration. By
Newton’s third law, the forces on the particles must be a pair of action/reaction forces. Notably,
since the change in momentum of each particle is equal to the force acting on it, Newton’s third
law implies here that the total momentum of the particles before the collision will be equal to the
total momentum of the particles after the collision, i.e., the total momentum of the system will be
conserved.
2.1.2 Conservation of Mass, Momentum, Energy. The physical principles of conservation of
mass, linear and angular momentum, and energy are also of central importance in physics-based
animation. A conserved quantity is one which cannot be created or destroyed.
Newton’s second law tells us that if there is no net force acting on a particle, then
𝑑
𝑚𝐯(𝑡) = 𝟎 ⇒ 𝑚𝐯(𝑡) = constant, (20)
𝑑𝑡
i.e., the momentum of the particle is conserved. By Newton’s third law, every action has an equal
and opposite reaction, which also leads to conservation of linear and angular momentum in a
closed system of interacting particles.
The principle of conservation of energy tells us that energy cannot be created or destroyed, but
can only change form, so that the total energy in a closed system remains constant. For example,
consider an object of mass 𝑚 dropped with zero initial velocity in a vacuum (so that there is no loss
of energy to air friction) from a height ℎ0 . Initially the object has potential energy 𝑚𝑔ℎ0 due to
the force of gravity. As the object falls, the potential energy is converted to kinetic energy 21 𝑚𝑣 2 ,
where 𝑣 = ‖𝐯‖ is the speed of the object. Since total energy is conserved and equal to the initial
energy 𝑚𝑔ℎ0 , we have
1
𝑚𝑔ℎ(𝑡) + 𝑚𝑣(𝑡)2 = 𝑚𝑔ℎ0 (21)
2√
⇒ 𝑣(𝑡) = 2(𝑔ℎ0 − 𝑔ℎ(𝑡)). (22)
10
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
time-varying velocity field of the fluid. The total mass in the region Ω is given by ∫Ω 𝜌𝑑𝑉 where 𝜌
is the fluid density and 𝑑𝑉 is a volume element. Conservation of mass tells us that the total amount
of mass in the fixed region Ω can only change in time due to flow of mass into or out of Ω through
its boundary 𝜕Ω. Mathematically, this is expressed as
𝑑
𝜌𝑑𝑉 = − ∮ 𝜌𝐯(𝐱, 𝑡) ⋅ 𝐧(𝐱)𝑑𝑆, (23)
𝑑𝑡 ∫Ω 𝜕Ω
where 𝐧(𝐱) is the outward unit normal on 𝜕Ω. Applying the divergence theorem to the right hand
side, and moving all terms to the left hand side gives
𝜕𝜌
∫ 𝜕𝑡 + ∇ ⋅ (𝜌𝐯) 𝑑𝑉 = 0. (24)
Ω
Since the control volume was arbitrary and this must hold for any control volume, we get that
𝜕𝜌
+ ∇ ⋅ (𝜌𝐯) = 0. (25)
𝜕𝑡
More details can be found in [Landau and Lifshitz 1959].
These conservation laws are local rather than global, so that if we lose mass in one part of the
domain but add it in another, such that the total global mass is conserved, the conservation law
would still be violated. In a simulation, this would amount to seeing a volume of fluid disappear
in one part of the domain and magically appear in another, a situation that is not desirable. The
local nature of the conservation laws means that mass, momentum, and energy should be locally
conserved everywhere.
In general, a local conservation law takes the form
𝜕𝑢
+ ∇ ⋅ 𝐟(𝑢) = 0, (26)
𝜕𝑡
where 𝑢 is the conserved quantity, and 𝐟(𝑢) is the flux function, representing the flow through the
boundary of the conserved quantity.
It is also possible to include sources or sinks on the right hand side of (23). These functions
are used to model the addition or removal of the conserved quantity through interaction with an
external system.
11
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
2.2 Materials
Physics-based animation is used for a wide variety of materials: rigid bodies which are idealized to
have no deformation, soft bodies that deform elastically and plastically, fluids such as air, water,
honey, and others materials such as sand and snow. In this section, we introduce the mathematical
models describing soft bodies, rigid bodies, and fluids. These models and their combinations form
the basis for most materials considered in physics-based animation.
2.2.1 Rigid Bodies.
Introduction. We saw previously that a system of particles connected by springs can be used
to model an elastic object. In many cases, we are interested in modeling very stiff objects for which
we are not concerned with elastic deformation. We could use a particle system connected with very
stiff springs, but this representation is inefficient compared to a rigid body approximation. A rigid
body is a object whose points are constrained to be at a fixed distance from one another, i.e., it is
assumed to not undergo any deformation. In this idealized limit, the position of all points on the
object can be describe with six degrees of freedom. First, the center of mass of the object can be
at any point in three-dimensional space, giving three positional degrees of freedom. Second, the
object can be oriented in any way about that center of mass, given three orientational degrees of
freedom. Using the constraint that all points in the rigid body remain a fixed distance from one
another, we arrive at a special form for the laws of motion of a rigid body.
For further reading, a thorough introduction to rigid body simulation can be found in [Baraff
2001].
Kinematics. Though we will use rigid bodies to model very stiff continuous media, for the
purposes of deriving the rigid body properties and laws, it is convenient to think of the rigid body
as composed of discrete particles labeled 𝑖 = 1, ⋯ , 𝑁 , each with mass 𝑚𝑖 . In what follows, discrete
sums over the constituent particles can be replaced with continuous integrals to derive the results.
The center of mass, 𝐱𝑐𝑜𝑚 of the rigid body is the mass-weighted average position of the rigid
body’s constituent particles,
∑𝑁
𝑖=1 𝑚𝑖 𝐩𝑖
𝐱𝑐𝑜𝑚 = . (27)
∑𝑁
𝑖=1 𝑚𝑖
12
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
Fig. 3
It is convenient to fix a coordinate system to the body, with its origin at the body’s center of mass.
Coordinates of points on the body relative to this fixed coordinate system are said to be in object
space. In constrast, the usual common space in which all objects are defined is now referred to
as world space. As the body translates and rotates over time, its center of mass and constituent
particles will move in space. Hence, while the object space coordinates of the body particles are
fixed, the world space coordinates generally change over time. A rigid body in object space and
world space is depicted in Figure 3.
Consider a particle of the rigid body with object space position 𝐫0 . At time 𝑡 , the position of the
body center of mass is given by 𝐱(𝑡), and the orientation of the body can be described by a rotation
matrix 𝐑(𝑡) about the center of mass. Therefore, the world space position of the particle is given by
𝐩(𝑡) = 𝐱(𝑡) + 𝐑(𝑡)𝐫0 . (28)
We will also write
𝐫(𝑡) = 𝐑(𝑡)𝐫0 , (29)
to represent the rotated particle position about the center of mass, so that 𝐩(𝑡) = 𝐱(𝑡) + 𝐫(𝑡) as
shown in Figure 3b.
The velocity of a particle of the rigid body can be found by differentiating (28) with respect to
time, to get
̇ = 𝐱(𝑡)
𝐯(𝑡) = 𝐩(𝑡) ̇
̇ + 𝐑(𝑡)𝐫0. (30)
Linear and Angular Velocity. The velocity of the rigid body center of mass, 𝐱(𝑡) ̇ , is referred
as the rigid body linear velocity, and is analogous to the velocity of a single particle. Notice that the
motion of a particle on the body in Eq. (30) contains this term. It is the component of the motion of
̇
the particle due to the linear velocity of the body. If the body is not rotating, i.e., 𝐑(𝑡) = 0, then
̇ , and the velocity of the particle is identical to the velocity of the body center of mass.
̇ = 𝐱(𝑡)
𝐩(𝑡)
̇
For a rigid body that is rotating, 𝐑(𝑡) ̇
≠ 0. Let us examine this term further. This term 𝐑(𝑡)𝐫 0 in
Eq. (30) represents the component of motion of the particle due to the instantaneous rotation of
the body about its center of mass. Euler’s rotation theorem tells us that this instantaneous rotation
13
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
must be equivalent to a rotation about a single axis that runs through the center of mass. We let 𝝎
be the vector whose direction is the instantaneous axis of rotation and whose length is the rate of
rotation in radians per second. Figure 4 illustrates the motion of the point 𝐩 due to the rotation. Let
Fig. 4. For a body with angular velocity 𝝎 , a point at 𝐫 on the body relative to the body center of
mass rotates about about the center of mass with velocity 𝝎 × 𝐫.
𝜃 be the angle between 𝝎 and 𝐫, and 𝑟 = ‖𝐫‖. Since the point rotates ‖𝝎 ‖ radians/sec on a circle of
radius 𝑟 sin 𝜃 , the speed of motion of the particle is ‖𝝎 ‖‖𝐫‖ sin 𝜃 , and the direction of motion of the
particle is perpendicular to 𝝎 and 𝐫 and given by the right-hand rule. Hence, we have that
̇
𝐑(𝑡)𝐫0 = 𝝎(𝑡) × 𝐫(𝑡). (31)
̇ = 𝐱(𝑡)
𝐯(𝑡) = 𝐩(𝑡) ̇ + 𝝎(𝑡) × 𝐫(𝑡). (32)
where the cross product is understood to apply to each column of the matrix.
Linear Momentum. The momentum of the rigid body is given by the sum of the momenta of
its constituent particles,
𝑁
𝐏(𝑡) = ∑ 𝑚𝑖 𝐯𝑖 (𝑡). (35)
𝑖=1
14
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
15
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
Notice that the term in parentheses depends only on the masses of the particle and their geometric
distributions. This 3 × 3 matrix is called the inertia tensor of the body, and is often denoted by
𝑁
𝐈(𝑡) = ∑ 𝑚𝑖 𝐫⋆𝑖 (𝑡)𝐫⋆𝑇
𝑖 (𝑡). (48)
𝑖=1
The inertia tensor describes the distribution of mass in a rigid body and can be readily computed
directly from a closed triangle mesh. With the inertia tensor, we can write
𝐋(𝑡) = 𝐈(𝑡)𝝎(𝑡). (49)
Though it depends on time, we can also express the inertia tensor as a transformation of the
object space inertia tensor by noting that 𝐫⋆ 𝐫⋆𝑇 = 𝐫𝑇 𝐫𝜹 − 𝐫𝐫𝑇 , where 𝜹 is the 3 × 3 identity matrix,
and substituting 𝐫 = 𝐑𝐫0 to get
𝑁
𝐈(𝑡) = ∑ 𝑚𝑖 𝐫⋆𝑖 (𝑡)𝐫⋆𝑇
𝑖 (𝑡) (50)
𝑖=1
𝑁
= ∑ 𝑚𝑖 (𝐫𝑇𝑖 𝐫𝑖 𝜹 − 𝐫𝑖 𝐫𝑇𝑖 ) (51)
𝑖=1
𝑁
= 𝐑(𝑡) ∑ 𝑚𝑖 (𝐫𝑇0𝑖 𝐫0𝑖 𝜹 − 𝐫0𝑖 𝐫𝑇0𝑖 ) 𝐑(𝑡)𝑇 (52)
𝑖=1
= 𝐑(𝑡)𝐈0 𝐑(𝑡)𝑇 . (53)
Thus, the inertia tensor at time 𝑡 is the constant object-space inertia tensor 𝐈0 transformed to
account for the current body orientation.
Force and Torque. Newton’s second law relates the time rate of change of momentum of a
body to the net force on the body. In the case of a rigid body, Newton’s second law takes the form
𝑑 𝐏(𝑡) 𝐟(𝑡)
= , (54)
𝑑𝑡 ( 𝐋(𝑡) ) ( 𝝉(𝑡) )
where 𝐟 is the net force on the body, and 𝝉 is the net torque on the body.
If a force 𝐟 is applied to a rigid body at its center of mass, then the body responds as if it was a
particle with mass 𝑀 , that is, its particles undergo an acceleration 𝐚 = 𝐟/𝑀 . When a force is applied
to the body at a point other than its center of mass, this may generate a torque as well. The torque
due to an applied force at a point 𝐩 located at 𝐫 from the center of mass is equal to
𝝉 = 𝐫 × 𝐟. (55)
Since the magnitude of the torque is ‖𝝉 ‖ = ‖𝐫‖‖𝐟 ‖ sin 𝜃 , where 𝜃 is the angle between 𝐫 and 𝐟 , the
torque can be increased by increasing either the applied force or the distance at which it is applied.
Summary. In summary, if we define the auxiliary quantities, 𝐯(𝑡), 𝐈(𝑡), and 𝝎(𝑡) as,
𝐏(𝑡)
𝐯(𝑡) = , 𝐈(𝑡) = 𝐑(𝑡)𝐈0 𝐑(𝑡)𝑇 , and 𝝎(𝑡) = 𝐈(𝑡)−1 𝐋(𝑡), (56)
𝑀
then the update to the state of the rigid body is given by,
⎛ 𝐱(𝑡) ⎞ ⎛ 𝐯(𝑡) ⎞
𝑑 ⎜𝐑(𝑡)⎟ ⎜𝝎 ⋆ (𝑡)𝐑(𝑡)⎟
⎜ 𝐏(𝑡) ⎟ = ⎜ 𝐟(𝑡) ⎟ . (57)
𝑑𝑡 ⎜ ⎟ ⎜ ⎟
⎝ 𝐋(𝑡) ⎠ ⎝ 𝝉(𝑡) ⎠
2.2.2 Soft Bodies.
16
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
Introducing Elasticity into Newton’s Second Law. To model soft bodies we incorporate
elastic and damping forces into Newton’s second law, 𝐟 = 𝑀𝐚. Elastic forces are often expressed
as a function of displacements, 𝐝, so that zero displacement results in zero force, but can also be
written as a function of position, 𝐱. Damping forces are usually a function of velocity, which is the
time deriviative of 𝐝 or 𝐱,
𝑑𝐱 𝑑𝐝 ̇
= = 𝐱̇ = 𝐝, 𝐯= (58)
𝑑𝑡 𝑑𝑡
where an overdot is shorthand for a time derivative. The resulting dynamic system is
𝐊(𝐝) + 𝐃(𝐝)̇ + 𝐌𝐝̈ = 𝐟 𝑒𝑥𝑡 , (59)
̇
where 𝐊(𝐝) represents internal elastic forces, 𝐃(𝐝) represent damping forces, 𝐌 is the mass matrix,
and 𝐟 𝑒𝑥𝑡 is external forces (such as gravity or wind). After discretization both 𝐊 and 𝐃 will be
matrices as well, with 𝐊 referred to as the “stiffness” matrix and 𝐃 as the “damping” matrix. The
stiffness matrix, which determines the magnitude of elastic forces, is the negative of the Jacobian
of the the elastic forces with respect to position, 𝐊 = −𝜕𝑓 /𝜕𝑥 and is positive semi-definite. It is also
the negative Hessian of the elastic energy, 𝐊 = −𝜕 2 𝜂/𝜕𝑥𝑖 𝜕𝑥𝑗 , which makes clear that 𝐊 encodes the
elastic relationships between particles in the system. In the commonly adopted Rayleigh damping
model, 𝐃 = 𝜆𝐊 + 𝜇𝐌. 3 Notice the similarity to the damped zero-length Hookean spring,
̇
𝐟 = −𝑘𝐝 − 𝑐 𝐝. (60)
x (u2 )
<latexit sha1_base64="gdirpvehbtdSjrAIStA3Yx0+PC8=">AAACTnicbVDLahsxFNU4fTjuK49lNqKm0JUZhUK6DG4XWaYQxwHPYDSaO4mwpBmkO22M0Ed0m/xUtvmR7EorPyiN0wtCh3PO5d57ikZJh2l6n3S2nj1/8bK73Xv1+s3bdzu7e+eubq2AkahVbS8K7kBJAyOUqOCiscB1oWBczL4s9PF3sE7W5gznDeSaXxpZScExUuNs6NswPZzu9NNBuiz6FLA16JN1nU53E5aVtWg1GBSKOzdhaYO55xalUBB6Weug4WLGL2ESoeEaXO6X+wb6ITIlrWobn0G6ZP/t8Fw7N9dFdGqOV25TW5D/0yYtVp9zL03TIhixGlS1imJNF8fTUloQqOYRcGFl3JWKK265wBhRLzPwQ9Rac1P6bBgmLPfZYobE1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HtqMJYkPZnWHDNY+g=">AAACYnicbVDLjhMxEHSG1zI8NoETgoNFQFou0QxCgmMUOHBcJLK7UjyKPJ6exFrbM7J7IJFl8TVc4Xu48yE4DxBkaclyuapa3a6yVdJhlv3oJdeu37h56+h2eufuvfvH/cGDM9d0VsBUNKqxFyV3oKSBKUpUcNFa4LpUcF5evt3o55/AOtmYj7huodB8YWQtBcdIzfuP2MSvAlNQ40mEXZhnzMrFEl/M+8NslG2LXgX5HgzHz8i2TueDXs6qRnQaDArFnZvlWYuF5xalUBBS1jloubjkC5hFaLgGV/jtHwJ9HpmK1o2NxyDdsn93eK6dW+syOjXHpTvUNuT/tFmH9ZvCS9N2CEbsBtWdotjQTSC0khYEqnUEXFgZd6ViyS0XGGNLmYHPotGam8qzSZjlhWebGRJ3d1n7YR5C+NdYYfDsHSjkFA+l1R9pFdIYcn4Y6VVw9nKUZ6P8w6vheLJLmxyRx+QpOSE5eU3G5D05JVMiyBfylXwj33s/kzQZJA931qS379m/f1fy5BdZRLnl</latexit>
Fig. 5. A function 𝐱(𝐮) maps points in rest (or material or object) space 𝐮𝑖 to points in world space, 𝐱𝑖 .
Deformation Gradient. We begin by defining a deformation function 𝐱(𝐮) that maps points
in a rest space, 𝐮𝑖 , to points in world space, 𝐱𝑖 . This mapping may be arbitrarily complicated, but
we can always linearize about a point, 𝐮0 , to arrive at a familiar affine transformation,
𝐱(𝐮) = 𝐱(𝐮0 ) + 𝐀 (𝐮 − 𝐮0 ) , (61)
where 𝐀 is an arbitrary 𝑑 × 𝑑 (in 𝑑 -dimensional space) transformation matrix and 𝐱(𝐮𝟎 ) is the world
space position corresponding to 𝐮0 , which can be thought of as a translation. Elastic forces work
to ensure that this mapping is a rigid transformation—a global rotation and translation—and are
determined by the gradient of this mapping, the deformation gradient, 𝜕𝐱/𝜕𝐮, which is commonly
denoted 𝐅 and for this linearized mapping is simply the matrix 𝐀. This 𝑑 × 𝑑 matrix describes
how infinitesimal vectors/lengths/displacements in rest space are mapped to world space (ignoring
3 We have adopted the convention that 𝐊 is positive semi-definite, other authors choose 𝐊 to be negative semi-definite.
17
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
Strain. From the deformation gradient we define a strain metric. Strain is a dimension-less (or
unit-less) quantity that measures the amount of deformation. Because strain is dimension-less
it does not depend on the scale of an object. There are several strain metrics commonly used in
computer graphics: Green’s finite strain, Cauchy’s infinitesimal strain, and the co-rotated strain.
Green’s finite strain, also known as the right Cauchy-Green strain, is given by
1 𝜕𝐱 𝜕𝐱 1
𝜖𝑖𝑗 = ⋅ − 𝐈 = (𝐅𝑇 𝐅 − 𝐈) . (62)
2 ( 𝜕𝑢𝑖 𝜕𝑢𝑗 ) 2
This strain metric is straightforward and simple and has the significant property that it does not
penalize world-space rotations, which led to widespread early adoption in computer graphics.
Unfortunately, this metric is quadratic in positions, leading to a quartic energy function, which in
turn leads to a stiffness matrix, 𝐊—the Hessian (second derivative) of the energy—that is quadratic
in positions. The result is that Green’s strain always results in a non-constant 𝐊, which makes
various pre-computations and pre-factorizations invalid and results in significant computational
cost.
To derive Cauchy’s infinitesimal strain let us re-write the deformation gradient as 𝐅 = 𝐈 + 𝐃.
Then Green’s strain is
1
𝜖= (𝐈 + 𝐃)𝑇 (𝐈 + 𝐃) − 𝐈) (63)
2(
1 𝑇
= 𝐈 𝐈 + 𝐃𝑇 + 𝐃 + 𝐃𝑇 𝐃 − 𝐈) (64)
2(
1
= 𝐃𝑇 + 𝐃 + 𝐃𝑇 𝐃) (65)
2(
1
= (𝐃 + 𝐈)𝑇 + (𝐃 + 𝐈) + 𝐃𝑇 𝐃) − 𝐈 (66)
2(
1 𝑇
= 𝐅 + 𝐅 + 𝐃𝑇 𝐃) − 𝐈 (67)
2(
(68)
4 Note that the Singular Value Decomposition is not unique. Singular values are unique and, if they are distinct, singular
vectors are unique, up to the sign. For repeated singular values, the associated vectors form an orthonormal basis for the
subspace associated with the singular value, so are not unique. Also, the singular values and vectors can be permuted and
still form a valid decomposition, though it is common to order them from largest to smallest. It is sometimes helpful to view
the SVD as 𝐔𝚺𝐕𝑇 = ∑𝑖 𝝈 𝑖 𝐮𝑖 𝐯𝑇𝑖 , where we are using the subscript to select column of the matrices. That is, the original
matrix is a sum of outer products of the singular vectors, weighted by their singular values.
18
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
Now if deformation is small (i.e. infinitesimal), then the 𝐃𝑇 𝐃 term is negligable compared to the
other terms and can be dropped, resulting in Cauchy’s infinitesimal strain,
1 𝑇 1
𝜖= (𝐅 + 𝐅) − 𝐈 = (𝐅 + 𝐅𝑇 ) − 𝐈, (69)
2 2
or using Einstein notation,
1 𝜕𝐱 𝜕𝐱
𝝐 𝑖𝑗 = + −𝛿 . (70)
2 ( 𝜕𝑢𝑖 𝜕𝑢𝑗 ) 𝑖𝑗
The primary advantage of this strain metric is that it is linear, which leads to a quadratic energy
and a constant Hessian that can be pre-factored or otherwise analyzed. The entire field of modal
analysis is derived from this assumption that elastic deformations will occur, but will be very
small. Unfortunately, this strain metric does penalize world-space rotations, leading to a variety of
unpleasant artifacts under large deformations.
By far the most common strain model in computer graphics since its introduction in the mid-
2000s is the co-rotated strain metric. Intuitively, this model is Cauchy’s linear strain with the
rotation explicitly removed through the polar decomposition. Once the deformation gradient, 𝐅, is
computed, we compute the polar decomposition 𝐅 = 𝐐𝐅̃ and replace 𝐅 with 𝐅̃ in Equation (69),
1 ̃ ̃𝑇
𝜖= 𝐅 + 𝐅 ) − 𝐈. (71)
2(
By explicitly discarding the rotation the metric does not penalize rotations. The changing rotations
mean that stiffness matrix is no longer constant, though some pre-computation is still possible and
𝑇
implementations can be quite efficient. It is worth noting that since 𝐅̃ is symmetric, 𝐅̃ = 1/2(𝐅̃ + 𝐅̃ ),
but, while the values of these functions are equivalent, their derivatives are not.
Stress. Unlike strain, stress is not a dimension-less quantity. In three dimensions, stress has
units of Newton’s per meter squared (𝑁 /𝑚2 ). Instead of measuring the amount of deformation, it
measures the materials reaction to that deformation. Different materials have different stress-strain
relationships, which are often specified with parameterized models. Entire research careers in
material science have been devoted to developing stress-strain models and fitting their parameters
to real-world materials. The most common models in computer graphics are linear,
𝝈 = 𝐂𝝐, (72)
where 𝐂 is a rank-four tensor containing 81 entries. If we take into account that both 𝝈 and 𝝐
are symmetric, this reduces to 36 unique entries; further assuming that the material is iso-tropic
(doesn’t resist deformation in different directions differently), then there are just two parameters.
There are many ways for specifying these two coefficients (see wikipedia) but a convenient one is
the Lamé coefficients. In this case,
𝜎𝑖𝑗 = 𝜆𝜖𝑘𝑘 𝛿𝑖𝑗 + 2𝜇𝜖𝑖𝑗 , (73)
or in matrix notation
𝝈 = 𝜆Tr (𝜖) 𝐈 + 2𝜇𝜖. (74)
Here the stress is some constant times the strain plus a scaled identity matrix times the trace of
the strain. The second term approximately preserves volume. Far more sophisticated stress-strain
relationship have been developed, especially in the context of organic materials and elasto-plasticity
for, e.g. granular materials and snow.
19
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
Elastic Potential, Traction, and Force. The elastic potential energy density is the product of
stress and strain
1 1 1
𝜂 = 𝜎𝑖𝑗 𝜖𝑖𝑗 = 𝝈 ∶ 𝝐 = ∑ 𝜎𝑖𝑗 𝜖𝑖𝑗 . (75)
2 2 2 𝑖,𝑗
The total elastic energy in a soft body is found by integrating the energy density over the volume
of the body. Another important quantity is the traction, or force per unit area,
𝝉 = 𝝈𝐧, (76)
where 𝐧 is the unit-magnitude surface normal to the area being integrated over.
Elastic forces will seek to reduce the energy of the system, thus they will be in the direction of
the negative gradient of the energy. That is the force at a point, 𝐱𝑖 , will be
𝜕𝜂
𝐟𝑖 = − . (77)
𝜕𝐱𝑖
Forces can also be defined by integrating tractions over the boundary of a region, 𝑅 , (the foundation
of finite volume methods),
𝐟=∮ 𝝈𝐧 𝑑𝑆. (78)
𝜕𝑅
Stress Revisited. The definition of traction makes clear that stress maps from normals to forces
(per unit area). However, it is important to distinguish where these normals and forces are defined.
If both normals and forces are in world space, the stress is known as a Cauchy stress and often
written as 𝝈 . If the stress maps normals in material space to forces in material space it is known
as a second Piola-Kirchhoff stress and sometimes written as 𝐒. A first Piola-Kirchhoff stress maps
normals in material space to forces in world space and is written 𝐏. Now, watch out, when only
one stress is being considered it is often written with 𝝈 regardless of its definition. The stress
we defined earlier was actually a second Piola-Kirchhoff stress. Now its easy to convert between
these stresses since they all measure the same thing just in different coordinate systems. Letting
𝐽 = det(𝐅) we have
𝐏 = 𝐽 𝝈𝐅−𝑇 = 𝐅𝐒 (79)
By having different ways of specifying stress, we can choose whichever one is most convenient
for a given application. The first Piola-Kirchhoff is particularly attractive since it works with
normals in the material space (where they are often constant) and maps directly to forces in world
space (where they will be applied). But many material models (stress-strain relationships) yield a
second Piola-Kirchhoff stress.
Plasticity. Plasticity refers to permanent deformation that typically occurs when a material fails.
While sophisticated plasticity models have been developed in the graphics literature, incorporating
basic plastic effects is straightforward. We begin by breaking the deformation gradient 𝐅 into two
parts, an elastic part and a plastic part,
𝐅 = 𝐅𝑒 𝐅𝑝 . (80)
Then when computing elastic strain, stress, forces, etc, we ignore the plastic part and only use
the elastic part, 𝐅𝑒 . Intuitively, 𝐅𝑝 measures how the rest shape is (permanently) changing and
𝐅𝑒 is measuring how the mapping from rest to world space. Elastic forces will seek to undo the
latter deformation. The sophistication we referred to earlier has to do with how the decomposition
in Equation (80) is formulated and is beyond the scope of these notes.
20
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
2.2.3 Fluids. Fluids surround us in our daily lives, from the air that we breathe, to water droplets,
oceans, and fire. Other materials that flow include sand, toothpaste, and putty. Intuitively, we can
think of a fluid as a material that flows to conform to the shape of its container. Physically, a fluid is
a material that, unlike a solid, cannot support a shear force and instead rearranges itself in response.
Fluids do support compressive forces, as can be seen by considering a balloon filled with air, where
the elastic balloon exerts compressive forces that are balanced by air pressure.
Here, we give a brief overview of the quantities and equations describing fluid motion. We refer
the interested reader to the excellent comprehensive text on fluid simulation in computer graphics
by Bridson [2015]. Many of the fluids of interest in physics-based animation can be described by
the incompressible Navier-Stokes equations,
where 𝜌 is the fluid density, 𝐮(𝐱, 𝑡) = (𝑢(𝐱, 𝑡), 𝑣(𝐱, 𝑡), 𝑤(𝐱, 𝑡))𝑇 is the three-dimensional fluid
velocity, 𝐮𝑡 is shorthand for 𝜕𝐮/𝜕𝑡 , 𝑝 is the pressure, 𝜇 is the dynamic viscosity, and 𝐟 represents
body forces such as gravity. Note that the mathematics community tends to use Δ to denote the
Laplacian operator, while the engineering community tends to favor 𝛁2 ; 𝛁 ⋅ 𝛁 is also sometimes
used. The first equation is derived using the principle of conservation of momentum [Landau and
Lifshitz 1959; Bridson 2015]. In the form given it has units of force per unit volume (𝑁 /𝑚3 ), and is
analogous to Newton’s second law 𝑚𝑎 = 𝑓 .
Material derivative. On the left hand side, we identify the density 𝜌 with the mass 𝑚, while
the acceleration term takes the form
𝐮𝑡 + 𝐮 ⋅ ∇𝐮. (83)
To understand where the acceleration form in Eq. (83) comes from, consider a fluid particle with
position 𝐱𝑝 (𝑡). Above, we described the fluid velocity field 𝐮(𝐱, 𝑡) as a function of position 𝐱 and
time 𝑡 . The fluid particle will be moving through the fluid velocity field. At any given time, the
velocity of the fluid particle 𝐯𝑝 (𝑡) is equal to the velocity at the particle’s position,
21
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
out the derivative in terms of its components, recalling that 𝐮 = (𝑢, 𝑣, 𝑤)𝑇 :
𝐷𝐮 ⎛ 𝑢𝑡 + 𝐮 ⋅ ∇𝑢 ⎞
= 𝐮𝑡 + 𝐮 ⋅ ∇𝐮 = ⎜ 𝑣𝑡 + 𝐮 ⋅ ∇𝑣 ⎟ .
𝐷𝑡 ⎜ ⎟
⎝𝑤𝑡 + 𝐮 ⋅ ∇𝑤 ⎠
Forces. On the right hand side of Eq. (81) are the forces acting on the fluid. The first term is the
negative pressure gradient in the flow. The pressure 𝑝(𝐱, 𝑡) is a scalar field, that in an incompressible
fluid acts everywhere to maintain the volume of the flow, resisting any compression or expansion
forces. Since the gradient of a function points uphill in the direction of steepest increase, and hence
the negative gradient points downhill, this forcing term drives the flow from areas of high pressure
to areas of low pressure. In an incompressible fluid, the pressure forces arise internally to resist
compression or expansion due to other forces. The pressure field will take on exactly the values
needed to ensure that the fluid in any arbitrary region does not compress or expand. For this reason,
it is sometimes called a “Lagrange multiplier” for the divergence-free constraint on the fluid, a
concept we will discuss Section 5.
The second term on the right hand side of Eq. (81) represents the viscous forces in the fluid. The
dynamic viscosity of the fluid, 𝜇 , is a material parameter that depends on the type of fluid. Generally,
“thicker” fluids like honey have a high viscosity. The viscosity of water is one to two orders of
magnitude larger than the viscosity of air, while honey is three to four orders of magnitude more
viscous than water. Viscosity is also sometimes specified in terms of the kinematic viscosity, 𝜈 = 𝜇/𝜌 .
Viscous forces arise from drag between layers of fluid flowing at different velocities. The Laplacian
operator, Δ, can be thought of as measuring the difference between the value of a function at a
point and the average surrounding values, and the viscous force 𝜇Δ𝐮 in Eq. (81) penalizes velocity
differences, acting to equalize velocities throughout the fluid. When a viscous fluid flows past a
solid wall, the fluid particles adjacent to the wall experience drag from the wall and stick to it. This
is called the no-slip boundary condition and says that the fluid should not slip at the surface of the
wall. Mathematically, this is expressed as
𝐮(𝐱, 𝑡) = 𝐕(𝐱, 𝑡), 𝐱∈Γ
where 𝐕 is the velocity of the solid wall, and Γ is the boundary of the fluid domain in contact with
the wall.
Finally, the 𝐟 in Eq. (81) represents other forces such as gravity. It may also be used to model a
variety of other effects, such as surface tension forces, control forces for driving the flow based on
artistic goals, or forces due to elastic stuctures embedded in the fluid.
Incompressibility. As we saw in Section 2.1.2, conservation of mass leads to the conservation
law
𝜌𝑡 + ∇ ⋅ (𝜌𝐮) = 0.
Applying the product rule to the spatial derivative term gives
∇ ⋅ (𝜌𝐮) = 𝜕𝑥 (𝜌𝑢) + 𝜕𝑦 (𝜌𝑣) + 𝜕𝑧 (𝜌𝑤) (87)
= (𝜕𝑥 𝜌)𝑢 + (𝜕𝑦 𝜌)𝑣 + (𝜕𝑧 𝜌)𝑤 + 𝜌(𝜕𝑥 𝑢 + 𝜕𝑦 𝑣 + 𝜕𝑧 𝑤) (88)
= 𝐮 ⋅ ∇𝜌 + 𝜌∇ ⋅ 𝐮. (89)
Therefore, conservation of mass can be written as
𝐷𝜌
+ 𝜌∇ ⋅ 𝐮 = 0,
𝐷𝑡
using the notation for the material derivative. Since the fluid should not compress or expand under
𝐷𝜌
the incompressibility assumption, 𝐷𝑡 = 0, so the conservation of mass equation reduces to the
22
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
0 = ∫ ∇ ⋅ 𝐮 𝑑𝑉 = ∫ 𝐮 ⋅ 𝐧 𝑑𝑆, (91)
Ω 𝜕Ω
which says that the total flow through the boundary of any region in the flow must be zero. If other
forces attempt to compress or expand the fluid, an internal pressure arises to counteract those
forces and prevent the change in volume.
23
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
3 SPATIAL DISCRETIZATION
In this section we review essential concepts for spatially discretizing continuous equations of
motion. We first discuss Lagrangian and Eulerian reference frames, then discuss the most common
spatial data structures used to store simulation variables before discussing how quantities stored
in the structures are interpolated at arbitrary points in space. Finally, we discuss two of the most
common approaches to discretizing equations of motion: finite differences and finite element
methods.
24
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
wi,j,k+1
vi,j+1,k
<latexit sha1_base64="KKphge87q8yAv89FOnlyiwT7oa8=">AAACG3icbVDLSgMxFM3UV62vqks3g0UQLGXiRpelblxWsA+YGUomzbSxeQxJxlKG+QyX6se4E7cu/BY3po+Fth4IOZxzL/feEyWMauN5X05hbX1jc6u4XdrZ3ds/KB8etbVMFSYtLJlU3QhpwqggLUMNI91EEcQjRjrR6Gbqdx6J0lSKezNJSMjRQNCYYmSs5I97Ga0+VEcXMO+VK17Nm8FdJXBBKmCBZq/8HfQlTjkRBjOktQ+9xIQZUoZiRvJSkGqSIDxCA+JbKhAnOsxmK+fumVX6biyVfcK4M/V3R4a41hMe2UqOzFAve1PxP89PTXwdZlQkqSECzwfFKXONdKf3u32qCDZ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yADHnCPRzfxm7rlB5o9mUF38YZRV3TzPyyYt92820+Riv+46dffMxNaEAouwDTuwBy4cQgNO4BRagIHDAzzBs/VovViv1ltRWrImPVvwC9b7N6zxo04=</latexit>
sha1_base64="0aksVMGhaShoHzGNw6oHZvJ7D4I=">AAACGXicbVC7TsMwFHUKhRJeBUaWiAqJoaoShARjVRbGItEHSqLKcZ3W1HYi26EqUb6CEfgSJjbEyoT4lC64jwFajmT56Jx7de89QUyJVLb9ZeRWVvNr64UNc3Nre2e3uLfflFEiEG6giEaiHUCJKeG4oYiiuB0LDFlAcSsYXE781j0WkkT8Ro1i7DPY4yQkCCot3Q47KSnflQdZp1iyK/YU1jJx5qRUPXv4hq/5cb1THHvdCCUMc4UolNJ17Fj5KRSKIIoz00skjiEawB52NeWQYemn04Uz61grXSuMhH5cWVP1d0cKmZQjFuhKBlVfLnoT8T/PTVR44aeEx4nCHM0GhQm1VGRNrre6RGCk6EgTiATRu1qoDwVESmdkehwPUcQY5N3Uq2Wu46feZAZRsz8I05KTZZmp03IWs1kmzdOKY1ecax1bDcxQAIfgCJwAB5yDKrgCddAACDDwCJ7Bi/FkvBnvxsesNGfMew7AHxifP0UkpQo=</latexit>
hierarchical structure, such as an octree or B-tree, is typically used to represent the full domain.
OpenVDB [Museth 2013] is an example of such a structure.
A question that arises when considering grids is where to store simulation variables. It is equally
natural to store variables at cell centers or at vertices and either convention is frequently adopted.
A special case, known as the staggered grid (sometimes less-usefully referred to as the MAC grid,
because it was introduced by Harlow and Welch [1965] with their Marker-and-Cell fluid simulation
method) stores different variables at different locations. This structure is commonly used in fluid
simulation to achieve second-order accuracy when using finite differences at small additional
computational cost. The resulting computer code is more complicated than when variables are
co-located. In this case individual component of the velocity 𝐮 are stored as scalars at face centers,
while pressure is stored at cell centers, see Figure 6. Note that some authors prefer using half-index
notation so that a velocity may be referred to as 𝑢𝑖−1/2,𝑗,𝑘 , but this maps less cleanly to computer
code.
Meshes. “Meshes” itself is an ill-defined term, but typically the term is used to refer to simplicial
complexes. A 𝑘 -simplex contains 𝑘 + 1 vertices that are all connected. A 0-simplex is a point, a
1-simplex a line segment or edge, a 2-simplex a triangle, and a 3-simplex a tetrahedron. A simplicial
complex is decomposes a domain into a set of disjoint simplices, triangles in 2D and tetrahedra in
3D. These simplices meet at lower-dimensional simplices forming the complex. For example, two
tetrahedra meet at a face, which will be a triangle. Similarly, two triangles meet at an edge, and two
edges meet at a vertex. Automatic tetrahedral meshing is still a difficult problem that continues
to receive attention from the SIGGRAPH and Computational Geometry research communities. In
fact, the difficulty of generating high quality tetrahedral meshes for arbitrary geometry remains a
significant impediment to their widespread use.
25
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
Particles. Given the difficulty of generating tetrahedral meshes, some choose to represent
geometry as a set of particles. Particles then typically interact with nearby particles. The primary
advantage of this approach is simplicity. The primary drawback is that, because space is not broken
into disjoint pieces, integration becomes more difficult.
Hybrid Structures. In recent years hybrid data structures have become increasingly common.
In particular combining Lagrangian particles with regular background grids, such as in the Fluid
Implicit Particle (FLIP) and Material Point Method (MPM) approaches, has proven very successful
at combining the various strengths of these two approaches.
3.3 Interpolation
As we saw previously, the values of scalar, vector, or tensor fields that we are tracking are often
sampled at discrete points on a grid, mesh, or set of particles. When the value of the field is required
at a location other than the sample points, it must be interpolated from the discrete samples to the
desired location. A simple example of interpolation is finding the value of some quantity on a line
segment between two endpoints for which we have samples, illustrated below. The samples at the
endpoints are 𝑓1 and 𝑓2 , 𝑡 is the fraction of the distance from 𝑓1 to 𝑓2 at which we want to determine
the value 𝑓 (𝑡). Linear interpolation between the endpoints gives us
𝑓 (𝑡) = (1 − 𝑡)𝑓1 + 𝑡𝑓2 .
As a sanity check, we see that this formula gives 𝑓 (0) = 𝑓1 and 𝑓 (1) = 𝑓2 as desired. Notice that the
formula is computing a weighted average of the two endpoints, with the weights of each endpoint
being the length ratio of the line sub-segment opposite the sample. Importantly, the weights in
any interpolation formula should always sum to 1, forming a partition of unity. This is indeed the
cases here as 1 − 𝑡 + 𝑡 = 1. The formula above can also be rearranged into 𝑓 (𝑡) = 𝑓1 + 𝑡(𝑓2 − 𝑓1 ),
but the former expression is more useful for generalizing to bilinear, trilinear, and barycentric
interpolation, as we do next.
26
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
We now move to two dimensions, where we have a function sampled at the four corners of
a rectangle or square, with samples 𝑓1 , 𝑓2 , 𝑓3 , 𝑓4 . If the function value is desired at a point inside
the rectangle, we can use bilinear interpolation. We first assign the coordinates (𝑠, 𝑡) to the point
in the rectangle, where 𝑠 is the fraction of the distance from 𝑓1 to 𝑓2 , and 𝑡 is the fraction of the
distance from 𝑓1 to 𝑓4 , as illustrated in the figure. With bilinear interpolation, we take a weighted
average of the function values at the four corner samples. As with linear interpolation, the weight
of each sample point is equal to the relative area of the region opposite that sample point, so that
the formula for bilinear interpolation is
𝑓 (𝑠, 𝑡) = (1 − 𝑠)(1 − 𝑡)𝑓1 + 𝑠(1 − 𝑡)𝑓2 + 𝑠𝑡𝑓3 + (1 − 𝑠)𝑡𝑓4 . (94)
Notice that, as required, the weights sum to 1. The formula can also be derived by using two linear
interpolation steps to intermediate values 𝑓5 and 𝑓6 , and then a final linear interpolation step to
𝑓 (𝑠, 𝑡) as illustrated below. From here, we have
27
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
As before, 𝛼 + 𝛽 + 𝛾 = 1, and can be determined by finding the ratio of the area of the opposite
subtriangle to the whole triangle. Specifically,
area(𝑝, 𝑏, 𝑐)
𝛼= , (102)
area(𝑎, 𝑏, 𝑐)
area(𝑝, 𝑐, 𝑎)
𝛽= , (103)
area(𝑎, 𝑏, 𝑐)
area(𝑝, 𝑎, 𝑏)
𝛾= . (104)
area(𝑎, 𝑏, 𝑐)
28
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
29
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
used in scattered data interpolation to reconstruct functions from unstructured data [Shen et al.
2005].
Approximating piecewise polynomial curves such as Bezier curves and B-splines are also some-
times used in physics-based animation to reconstruct functions from sample data [Marschner and
Shirley 2015].
Finally, we note that in the context of geometric deformation of character models, specialized
coordinates for interpolation have been developed that work with more general structures.These
include mean-value coordinates [Floater 2003; Ju et al. 2005] harmonic coordinate [Joshi et al. 2007],
green coordinates [Lipman et al. 2008], and bounded biharmonic weights [Jacobson et al. 2011].
30
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
or
𝑓 (𝑥) − 𝑓 (𝑥 − ℎ)
𝑓 ′ (𝑥) = + 𝑂(ℎ). (119)
ℎ
Like the forward difference, the backward different is first order accurate, although notice that
their dominant error terms differ by a sign. The significance of first order accuracy is that if the
spacing between sample points, ℎ, is halved, the dominant error term will also be halved as it is
linear in the size of the mesh spacing.
A common second order accurate finite difference discretization is the central difference,
𝑓 (𝑥 + ℎ) − 𝑓 (𝑥 − ℎ)
𝑓 ′ (𝑥) ≈ . (120)
2ℎ
We can again use Taylor series to study the order of accuracy, using
ℎ2 ′′ ℎ3 ′′′
𝑓 (𝑥 + ℎ) = 𝑓 (𝑥) + ℎ𝑓 ′ (𝑥) + 𝑓 (𝑥) + 𝑓 (𝑥) + 𝑂(ℎ4 ), (121)
2 6
ℎ2 ℎ3 ′′′
𝑓 (𝑥 − ℎ) = 𝑓 (𝑥) − ℎ𝑓 ′ (𝑥) + 𝑓 ′′ (𝑥) − 𝑓 (𝑥) + 𝑂(ℎ4 ). (122)
2 6
Taking the difference of these two expressions and dividing by 2ℎ, we get
𝑓 (𝑥 + ℎ) − 𝑓 (𝑥 − ℎ) 1 ℎ3
= 2ℎ𝑓 ′ (𝑥) + 𝑓 ′′′ (𝑥) + 𝑂(ℎ4 ) (123)
2ℎ 2ℎ ( 3 )
ℎ2
= 𝑓 ′ (𝑥) + 𝑓 ′′′ (𝑥) + 𝑂(ℎ3 ) (124)
6
= 𝑓 ′ (𝑥) + 𝑂(ℎ2 ) (125)
This shows that the dominant error term for the central difference is 𝑂(ℎ2 ), making it second order
accurate. This means if we decrease the mesh spacing from ℎ to ℎ/2, the dominant error term will
scale by a factor of 1/4. Thus, asymptotically, the error decreases more quickly with decreasing ℎ
in a higher order method.
When choosing a finite difference scheme, order of accuracy is only one of several considerations.
Other considerations include the overall stability of the scheme, the nature of the errors produced
by the scheme (e.g., dissipative or dispersive), and the conservation properties of the scheme. For
example, when discretizing advective terms in a partial differential equation, the central difference
scheme above can lead to undesirable oscillations or instabilities when combined with certain time
discretization methods. Upwind discretizations are often preferred for advection. These schemes use
the local flow direction to choose between the forward or backward differences, or higher-order
one-sided discretizations.
We can also approximate higher derivatives with finite difference approximations. For example,
we can write a central difference approxmation to 𝑓 ′′ (𝑥) as
𝑓 ′ (𝑥 + ℎ2 ) − 𝑓 ′ (𝑥 − ℎ2 )
𝑓 ′′ (𝑥) = + 𝑂(ℎ2 ) (126)
ℎ
𝑓 (𝑥+ℎ)−𝑓 (𝑥)
− 𝑓 (𝑥)−𝑓ℎ(𝑥−ℎ)
= ℎ + 𝑂(ℎ2 ) (127)
ℎ
𝑓 (𝑥 + ℎ) − 2𝑓 (𝑥) + 𝑓 (𝑥 − ℎ)
= + 𝑂(ℎ2 ), (128)
ℎ2
31
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
where Taylor series analysis of this finite difference approximation shows that the odd errors terms
in the approximations to 𝑓 (𝑥 − ℎ) and 𝑓 (𝑥 + ℎ) cancel perfectly, leaving an 𝑂(ℎ4 ) dominant error
term in the numerator, and thus giving second order accuracy.
Laplacian operator. Now consider approximating the Laplacian operator applied to a function
2 𝜕 2 𝑢 , and each of the two second
𝑢 , i.e., Δ𝑢 using finite differences. In two dimensions, Δ𝑢 = 𝜕𝜕𝑥𝑢2 + 𝜕𝑦 2
order derivatives can be approximated using the centered difference scheme in (128) as
𝜕 2 𝑢(𝑥, 𝑦) 𝑢(𝑥 + ℎ, 𝑦) − 2𝑢(𝑥, 𝑦) + 𝑢(𝑥 − ℎ, 𝑦)
≈ (129)
𝜕𝑥 2 ℎ2
2
𝜕 𝑢(𝑥, 𝑦) 𝑢(𝑥, 𝑦 + ℎ) − 2𝑢(𝑥, 𝑦) + 𝑢(𝑥, 𝑦 − ℎ)
≈ (130)
𝜕𝑦 2 ℎ2
Combining these, we get
𝜕 2 𝑢(𝑥, 𝑦) 𝜕 2 𝑢(𝑥, 𝑦) 𝑢(𝑥 + ℎ, 𝑦) − 2𝑢(𝑥, 𝑦) + 𝑢(𝑥 − ℎ, 𝑦) 𝑢(𝑥, 𝑦 + ℎ) − 2𝑢(𝑥, 𝑦) + 𝑢(𝑥, 𝑦 − ℎ)
+ ≈ +
𝜕𝑥 2 𝜕𝑦 2 ℎ2 ℎ2
(131)
𝑢(𝑥 + ℎ, 𝑦) + 𝑢(𝑥 − ℎ, 𝑦) + 𝑢(𝑥, 𝑦 + ℎ) + 𝑢(𝑥, 𝑦 − ℎ) − 4𝑢(𝑥, 𝑦)
= (132)
ℎ2
If we consider our function 𝑢 to be sampled at the nodes of a uniform two-dimensional grid, as
illustrated below and associate with the location 𝑥 , 𝑥 + ℎ, 𝑦 , 𝑦 − ℎ the grid indices 𝑖 , 𝑖 + 1, 𝑗 , 𝑗 − 1,
etc., respectively, we can write the finite difference approximation in a the commonly used form
𝑢𝑖+1,𝑗 + 𝑢𝑖−1,𝑗 + 𝑢𝑖,𝑗+1 + 𝑢𝑖,𝑗−1 − 4𝑢𝑖,𝑗
Δ𝑢(𝑥, 𝑦) ≈ (133)
ℎ2
The figure above illustrates which surrounding sample points are used in the finite difference
approximation, and is called the stencil of the finite difference scheme. The particular stencil
illustrated for the Laplacian is very commonly used and is called the five-point stencil. In one
dimension and three dimensions, the analogous stencils are the three- and seven-point stencils,
respectively.
We now consider discretizing the one-dimensional Poisson equation
𝑢𝑥𝑥 = 𝑓 , 𝑥 ∈Ω (134)
on a uniform one-dimensional grid of size 8. We use the finite difference approximation in (128) at
each point in the grid. Discretizing the Laplacian over the grid gives rise to a matrix that is sparse
yet globally couples all variables. Finite difference discretization of differential operators generally
gives rise to sparse matrices, since differential operators give local information about functions.
32
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
We number the 𝑛 samples from the left to right 𝑖 = 0, 1, … , 𝑛 − 1. At node 𝑖 on the grid, the finite
difference approximation gives the equation
𝑢𝑖−1 − 2𝑢𝑖 + 𝑢𝑖+1
= 𝑓𝑖 .
ℎ2
We apply this discretization at each of the 8 grid nodes and assemble the resulting equations into a
linear system. Here we notice that at the two endpoints of the grid, we do not have all the neighbors
required by the stencil. Mathematically, we require boundary conditions for the solution of Eq. (134)
to be fully determined. The boundary conditions are then used in discretizing the equation at the
boundary points near the boundary. If we assume, for example, the Dirichlet boundary condition
̄
𝑢(𝑥) = 𝑢(𝑥), 𝑥 ∈ 𝜕Ω, (135)
then the discretized Laplace equation for our example becomes the linear system
̄ )
𝑢(𝑥
⎛−2 1 0 0 0 0 ⎞ ⎛𝑢1 ⎞ ⎛𝑓1 − ℎ20 ⎞
⎜ 1 −2 ⎜ ⎟
1 0 0 0 ⎟ ⎜𝑢2 ⎟ ⎜ 𝑓2 ⎟
1 ⎜⎜ 0 1 −2 1 0
⎟⎜ ⎟ ⎜
0 ⎟ ⎜𝑢3 ⎟ 𝑓3 ⎟
= (136)
2
ℎ ⎜ 0 0 1 −2 1 0 ⎟ ⎜𝑢4 ⎟ ⎜⎜ 𝑓4 ⎟⎟
⎜0 0 0 1 −2 1 ⎟ ⎜𝑢5 ⎟ ⎜ 𝑓5 ⎟
⎜ ⎟⎜ ⎟ ̄ 7) ⎟
⎝ 0 0 0 0 1 −2⎠ ⎝𝑢6 ⎠ ⎜𝑓6 − 𝑢(𝑥
⎝ ℎ2 ⎠
Note how the first and last rows in the matrix have only 2 nonzero terms, while the rows corre-
sponding to interior samples have 3. For the first and last rows, the third term is a boundary term
and not an unknown, and hence appears on the right hand side of the equation.
Neumann boundary conditions, which specify derivatives are also common. If we assume that
the derivative at the boundary is zero,
𝜕𝑢(𝑥)
= 0 ∈ 𝜕Ω, (137)
𝜕𝑥
as we would for pressure at a solid boundary, then the discretized Laplace equation for our example
becomes the linear system
Note how the first and last rows in the matrix have only 2 nonzero terms and that the diagonal
entry has been reduced. For the first and last rows, the third entry must be equal to the solution
and the matrix entries cancel.
33
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
34
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
<latexit sha1_base64="/YWnvgzpDtV6CNot1FGM2b72lJk=">AAACH3icbVDLSsNAFJ3UV42vqks3wSK4Kkk3uix147KCfUASymQybYfOI8xMlDLkM9wqfo07cduv0STNQlsPDBzOuZd75kQJJUq77tKqbW3v7O7V9+2Dw6Pjk8bp2UCJVCLcR4IKOYqgwpRw3NdEUzxKJIYsongYze8Kf/iEpSKCP+pFgkMGp5xMCII6l/yga9JsbNpuZo8bTbfllnA2iVeRJqjQGze+g1iglGGuEYVK+Z6b6NBAqQmiOLODVOEEojmcYj+nHDKsQlNGzpyrXImdiZD549op1d8bBjKlFizKJxnUM7XuFeJ/np/qyW1oCE9SjTlaHZqk1NHCKf7vxERipOkiJxBJkmd10AxKiHTekh1w/IwEY5DHJuhmvheaIBI0LqIIaoLinmSm6WVZ2Zi33s8mGbRbntvyHtxmp1t1VwcX4BJcAw/cgA64Bz3QBwgI8AJewZv1bn1Yn9bXarRmVTvn4A+s5Q+bOaOC</latexit>
sha1_base64="PuUH45tvQ75b/y3hvyQ9nBUNTPI=">AAACH3icbVDLSsNAFL3xbX1VXboJFsFVTbrRZakblwq2FZJQJpOpDp1HmJkoZchnuFX8Gnfitl/hJ+ik7cLXgYHDOfdyz5w0Z1SbIJh4C4tLyyura+u1jc2t7Z367l5Py0Jh0sWSSXWTIk0YFaRrqGHkJlcE8ZSRfjo6r/z+PVGaSnFtxjlJOLoVdEgxMk6K4o4tyoFtBWVtUG8EzWAK/y8J56TRPjn+aAPA5aD+GWcSF5wIgxnSOgqD3CQWKUMxI2UtLjTJER6hWxI5KhAnOrHTyKV/5JTMH0rlnjD+VP2+YRHXesxTN8mRudO/vUr8z4sKMzxLLBV5YYjAs0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M09v9Fw1gluX57+T9N79nQcPdx9lj5883dvvHTw7s7o1DMZMC20uKmpBcAVjx52Ai8YAlZWA8+rqQzc//w7Gcq2+ukUDpaRzxWecURepaW9RjPzHgN9nRQVzrnwjqTP8JmSRvwlTT/KAX+N1c5hHHlS9sbWtajdV7V2qb/4tCdm0188H+bLwNiBr0B8e/frxEyF0Ou39LWrNWgnKMUGtnZC8caWnxnEmIHq0FhrKrugcJhEqKsGWfhlRwK8iU+OZNvEph5fspsJTae1CVnEzXnlpb8868q7ZpHWzd6XnqmkdKLYymrUCO427vHHNDTAnFhFQZni8FbNLaihz8VeyQsE101LSGE8xChNS+qLSou5O0cIXnZ+Rvk9CWCZGbuezDc4OByQfkC8xuhFa1S56gV6iN4igYzREn9ApGiOG/iQ7yV6ynx6kx+lJOlytpsla8xz9V+nnfw5Vyp8=</latexit>
sha1_base64="iYt6ETyINIoasnv75M7WPN6AOgU=">AAACj3icbVHLbhMxFPUMFMoAbQoSm24sIhAbonG7KBuqKEiI7opE2kqZIfJ47qRW/RjZHtrImk9hwUfwDXwDKz4FPEkWoemVLJ177j06V8dFLbh1afo7iu/d33rwcPtR8vjJ053d3t6zM6sbw2DMtNDmoqAWBFcwdtwJuKgNUFkIOC+uPnTz829gLNfqi5vXkEs6U7zijLpATXvzbOQ/tvh9khUw48rXkjrDb9ok8Dft1JO0xa/xqjlIAw+qXNvaVDXrquYu1Vf/lrTJtNdPB+mi8CYgK9AfHv76/qN68fN02vublZo1EpRjglo7IWntck+N40xA8Ggs1JRd0RlMAlRUgs39IqIWvwpMiSttwlMOL9h1hafS2rkswma48tLennXkXbNJ46p3ueeqbhwotjSqGoGdxl3euOQGmBPzACgzPNyK2SU1lLnwK0mm4JppKWmIJxu1E5L7rNCi7E7Rwmedn5G+T9p2kRi5nc8mODsYkHRAPofoRmhZ22gfvURvEEFHaIg+oVM0Rgz9ibainWg33ouP4uN4uFyNo5XmOfqv4pN/3K3L0Q==</latexit>
Fig. 7. The finite element method. To compute the deformation gradients we assemble matrices
composed of vectors along the edges of the elements in rest and world space. We invert the rest space
matrix and premultiple by the world space matrix.
object’s rest shape does not change, the matrix that needs to be inverted is constant and can be
precomputed. See Figure 7.
Probably the most common strain model in computer graphics, as mentioned in Section 2.2.2, is
the co-rotated model where we compute the polar decomposition 𝐅 = 𝐐𝐅̃ and then compute strain
as
1 𝑇
𝜖 = (𝐅̃ + 𝐅̃ ) − 𝐈. (145)
2
We can then compute stress as
𝝈 = 𝜆Tr (𝜖) 𝐈 + 2𝜇𝜖. (146)
And finally forces are given by
𝐟 = 𝐐𝝈𝐧𝑖 , (147)
where 𝐧𝑖 is the area weighted normal of the edge (2D) or face (3D) opposite the node the force is
acting upon in the rest configuration. The simplicity of the finite element approach can be seen in
Algorithm 25 , which differs little from Algorithm 1.
5 Thereare a couple of obvious optimizations: inverse(Matrix3x3(u1-u0, u2-u0, u3-u0)) in line 6 can be precomputed and line
8 can be simplified because Ftilde is symmetric.
35
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
4 TEMPORAL DISCRETIZATION
In addition to discretizing space, we must also discretize time. For the purposes of animation we
typically march forward through time outputing frames at some regular frequency. Though the
timestep can vary in size, a fixed timestep is often adopted for simplicity and to avoid unwanted
changes in material behavior, which may occur with changes in timestep size. Typically there are
several timesteps per frame of animation, but most modern animation systems try to take as few
steps per frame as possible.
is an explicit integrator. We have an explicit formula for 𝐱𝑝 (𝑡 + Δ𝑡) in terms of quantities evaluated
at time 𝑡 , 𝐱𝑝 (𝑡) and 𝐯(𝐱𝑝 , 𝑡). There are infinitely many such integration techniques all with different
properties. In studying such integrators it is important to remember that properties that are
important for particular applications, may not be important for computer animation and that
integration techniques that may seem very similar can have very different behavior in practice.
4.1.1 Trapezoidal Rule vs. Midpoint Method. Let’s take a closer look at the particular cas of
the Trapezoidal Rule and the Midpoint Method. You may remember these from your first calculus
class where you learned to integrate the area under a curve by computing the area of various
rectagles. See Figure 8. It turns out that these methods can also be applied to our problem of moving
massless particles through a velocity field from Section 1.1.
For the trapezoidal rule, we evaluate the velocity at the particle’s position, pretend to move
the particle a full timestep and evaluate the velocity again, then use the average of these two
36
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
Fig. 8. From left to right: Forward Euler, Trapazoidal Rule, and Midpoint Method.
𝑑𝑡
𝐱𝑝 (𝑡 + Δ𝑡) = 𝐱𝑝 (𝑡) + ⋅ 𝐯𝑝 (𝑡) + 𝐯𝑝 (𝑡 + Δ𝑡)) (152)
2 (
𝐱𝑝 (𝑡 + Δ𝑡) = 𝐱𝑝 (𝑡) + 𝑑𝑡 ⋅ 𝐯𝑝 (𝑡 + Δ𝑡). (153)
The first one doesn’t seem to have a name associated with it, but the middle one is sometimes
called Improved Euler and the third one is called Symplectic Euler. Obviously the only difference is
where the velocity is evaluated, at the beginning of the step, end of the step, or an average of both.
From the discussion above, the reader may guess that improved Euler is second-order accurate and
that is partially true. It turns out that depending on the problem improved Euler may not converge
at all. In particular, for pure elasticity problems one can fairly easily show that improved Euler
is unconditionally unstable for open-ended (i.e. infinite) time integration. That means no matter
37
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
Fig. 9. Trapazoidal Rule (top) vs. Midpoint Method (bottom) for integrating a path through a velocity
field. The black arrow is the first velocity evaluation, the orange arrow is the second, and the gray
arrow is the velocity used to upate the particles position. Note that the midpoint mehtod moves only
halfway along the path from the first estimate and that the trapazoidal rule uses the average of the
two velocity evaluations
octave:1> to update the position.
[x,y] = meshgrid(0:.5:2*pi,0:.5:2*pi);
quiver(x,y,x,5*cos(x))
38
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
how small the timestep the solution will still diverge. In practice, for most problems in computer
animation symplectic Euler is the preferred explicit integrator, despite its lower order accuracy.
Again, this demonstrates that there is more to chosing a numerical method than simple order of
accuracy and numerical experiments are often necessary to determine the best choice.
39
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
40
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
5 CONSTRAINTS
Newton’s second law describes the evolution of a body under applied forces. However, in many
scenarios, it is more natural and convenient to specify conditions on the positions or velocities
of the body that should be satisfied, rather than the forces acting on the body. These conditions
are referred to as constraints. For example, an object resting on a table is subject to gravity and
possibly other external forces, while constrained to not penetrate the table. How is this constraint
maintained physically? By Newton’s third law, the table pushes on the object with a force equal in
magnitude and opposite in direction to the force of the object on the table. The net effect on the
object will be to prevent penetration. The force associated with the non-penetration constraint will
be exactly the force necessary to maintain the constraint. In this scenario and others, the constraint
force arises instantaneously in response to other forces in the system to maintain the constraint. It
is thus more natural to specify the constraint and determine the necessary force than to specify the
constraint force. There are a many types of constraints as well as a variety of methods for solving
problems of constrained dynamics.
Fig. 10
freedom of the rigid bodies ignoring the constraint are 𝐱1 , 𝜃1 , and 𝐱2 , 𝜃2 , and the constraint can be
written as
𝐠(𝐱1 , 𝜃1 , 𝐱2 , 𝜃2 ) = (𝐱1 + 𝐫1 ) − (𝐱2 + 𝐫2 ) = 𝟎. (164)
41
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
Here 𝐠 ∶ ℝ6 → ℝ2 and implicitly removes two DOF, so that the constrained problem has 6 − 2 = 4
degrees of freedom. We can also see this as the system configuration is fully determined by
specifying the position of the attachment point in ℝ2 , and the angle of each rigid body, giving a
total of 4 DOF.
In a unilateral or inequality constraint, the equality sign in (163) is replaced by an inequality, so
that the constraint takes the form
𝑔(𝑥1 , 𝑥2 , … , 𝑥𝑛 , 𝑡) ≥ 0. (165)
This form of constraint arises when one body is in contact with another. In such cases, the bodies
are free to move apart, but are prohibited from interpenetrating. An example is illustrated below,
where a ball rests on a surface. The ball is constrained from moving into the surface, but can be
freely lifted off the surface. The point of contact is shown in light blue. The constraint can be
written as
𝐠(𝑥1 , 𝑦1 , 𝜃1 ) = 𝑦1 − ℎ ≥ 0, (166)
where 𝑦1 is the height of the center of the ball. This constraint allows the ball to slide, so that its
lateral position 𝑥1 and orientation 𝜃1 are independent. If the ball is further restricted to rolling,
then 𝑥1 and 𝜃1 would not evolve independently during contact.
Inequality constraints arise in other cases as well, for example when limits are set on the legal
range of joint angles in an articulated rigid body.
42
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
Lagrange multipliers are examples of approaches that use maximal coordinates. We discuss these
first.
Penalty methods. Penalty methods attempt to enforce constraints by penalizing constraint
violation using spring-like restoring forces. As an example, consider the scenario illustrated in
Figure 10 where the ends of two rigid bodies are attached. As a simple illustration of a penalty
method, we add a zero restlength spring that connects the two ends of the rigid bodies, as illustrated
below. The first rigid body then feels a force at its attachment point equal to
while the second rigid body feels a force at its attachment point equal to
More generally, penalty forces may be formulated based on an energy associated with the constraint
violation as in [Faure et al. 2008] and may include damping terms that depend on derivatives of the
constraint [Bender et al. 2014].
While penalty terms for constraint violation are relatively simple to implement, they do suffer
from several drawbacks [Drumwright 2008; Bender et al. 2014]. As with the parameter 𝑘 in our
example above, penalty force terms contain one or more strength parameters. Tuning stiffness
parameters in complex systems with many competing forces can be challenging. When 𝑘 is relatively
large, the constraint will be better maintained. However, this introduces a stiff force into the system
which will incur a severe time step restriction or necessitate implicit integration. Penalty forces can
also lead to undesirable oscillations and make scenes with resting contact of many bodies difficult
to achieve [Bender et al. 2014]. Nevertheless, penalty methods are still widely used, and researchers
continue to develop approaches to mitigate their drawbacks [Harmon et al. 2009; Tang et al. 2012;
Xu et al. 2014].
Lagrange multipliers. The method of Lagrange multipliers is an approach that explicitly
includes in the equations of motion the constraint forces necessary to maintain the constraints.
Unlike a penalty force, the constraint force is exactly that force needed to counteract any other
forces violating the constraint. Although mathematically this is sufficient to maintain a constraint
that is satisfied initially, in practice additional stabilization techniques are required to counteract
drift in the constraint satisfaction.
Consider the constraint equation
𝑔(𝐱) = 0, (169)
43
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
where 𝐱 = (𝑥1 , 𝑥2 , … , 𝑥𝑛 ). This is an implicit surface equation defining all the legal positions 𝐱. The
gradient of the constraint is the vector
𝜕𝑔
⎛ 𝜕𝑥1 (𝐱)⎞
⎜ 𝜕𝑔 ⎟
(𝐱)
∇𝑔(𝐱) = ⎜ 𝜕𝑥2 ⎟ . (170)
⎜ ⋮ ⎟
⎜ 𝜕𝑔 ⎟
⎝ 𝜕𝑥𝑛 (𝐱)⎠
As illustrated in the figure above, the gradient vector is perpendicular to the surface. A vector 𝐳
Displacements consistent with the constraint are those such that 𝛿𝐫 = 𝛼𝐳, so that 𝛿𝐫𝑇 ∇𝑔 = 0.
Therefore, constraint forces that satisfy (171) are exactly those forces of the form
𝐅𝑐 = 𝜆∇𝑔 (172)
for some scalar 𝜆. The scalar 𝜆 is known as the Lagrange multiplier for the constraint, and determines
the strength of the constraint force.
More generally, we consider 𝑚 constraint equations,
⎛ 𝑔1 (𝐱) ⎞ ⎛0⎞
⎜ 𝑔 (𝐱) ⎟ ⎜0⎟
𝐠(𝐱) = ⎜ 2 ⎟ = ⎜ ⎟ = 𝟎. (173)
⎜ ⋮ ⎟ ⎜⋮⎟
⎝𝑔𝑚 (𝐱)⎠ ⎝0⎠
The Jacobian of the constraints is the 𝑚 × 𝑛 matrix
𝜕𝑔 𝜕𝑔1 𝜕𝑔1
⎛ 𝜕𝑥11 (𝐱) 𝜕𝑥2 (𝐱) … 𝜕𝑥𝑛 (𝐱) ⎞⎛ ∇𝑔1 (𝐱)𝑇 ⎞
⎜ 𝜕𝑔2 𝜕𝑔2 𝜕𝑔2 ⎟⎜ ⎟
𝜕𝐠 (𝐱) 𝜕𝑥2 (𝐱) … 𝜕𝑥𝑛 (𝐱) ⎟ ∇𝑔 (𝐱)𝑇 ⎟
𝐽 (𝐱) = (𝐱) = ⎜ 𝜕𝑥1 =⎜ 2 . (174)
𝜕𝐱 ⎜ ⋮ ⎟ ⎜ ⋮ ⎟
⎜ 𝜕𝑔𝑚 𝜕𝑔𝑚 𝜕𝑔𝑚 ⎟ ⎜∇𝑔 (𝐱)𝑇 ⎟
⎝ 𝜕𝑥1 (𝐱) 𝜕𝑥2 (𝐱) … 𝜕𝑥𝑛 (𝐱)⎠ ⎝ 𝑚 ⎠
44
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
In this case, the total constraint forces is comprised of 𝑚 terms, one for each constraint, 𝜆1 ∇𝑔1 +
𝜆2 ∇𝑔2 + … + 𝜆𝑚 ∇𝑔𝑚 , which we write
𝐅𝑐 = 𝐽 𝑇 𝝀, (175)
for 𝝀 = (𝜆1 , 𝜆2 , … , 𝜆𝑚 ).
Given this form for the constraint forces, the equations of motion, including applied forces and
constraint forces, are written as
𝑀𝐚 = 𝐅 + 𝐅𝑐 = 𝐅 + 𝐽 𝑇 𝝀. (176)
We follow a derivation similar to [Baraff 1996; Witkin 2001]. The unknown 𝝀 can be determined
by requiring the acceleration 𝐚 of the system to be compatible with the constraint. To get this
condition, we differentiate the constraint equation with respect to time to get
̇
0 = 𝐠(𝐱) (177)
𝜕𝐠 𝑇
= ̇
𝐱(𝑡) (178)
𝜕𝐱
= 𝐽 (𝐱)𝐯(𝑡), (179)
This shows us that the legal velocities are those that are orthogonal to the constraint gradient,
parallel to 𝐳 in the figure above.
To get an expression involving the accelerations, we differentiate once more with respect to time
to get
̈
0 = 𝐠(𝐱) (180)
= 𝐽̇ 𝐯(𝑡) + 𝐽 𝐯(𝑡)
̇ (181)
= 𝐽̇ 𝐯(𝑡) + 𝐽 𝐚(𝑡) (182)
This is the condition that must be satisfied by the accelerations to maintain the position and velocity
level constraints. Plugging in 𝐚 from Eq. (176) into (182), we get
45
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
and expressing the equations of motion in terms of these coordinates and their derivatives. The
formulation of the equations of motion in terms of generalized coordinates is part of the subject of
variational mechanics, developed after Newton’s time by Euler, Lagrange, Hamilton, and others
[Lanczos 2012]. The choice of 𝑞𝑖 is not unique, but in some cases there may be a particular choice
which is natural and convenient.
The best-known example of generalized coordinates are those for a rigid body, which can be
viewed as a collection of particles where each pair of particles are constrained to be a fixed distance
apart. In three dimensions, a minimal set of six degrees of freedom, three for position and three for
orientation, is used to describe a rigid body. The maximal coordinates of any point on the body can
be calculated from the generalized coordinates using the well known formula in Section 2.2.1.
The 𝑛 (𝑛 > 𝑁 ) maximal coordinates are given as functions of the generalized coordinates,
𝑥1 = 𝑥1 (𝑞1 , 𝑞2 , … , 𝑞𝑁 ) (186)
𝑥2 = 𝑥2 (𝑞1 , 𝑞2 , … , 𝑞𝑁 ) (187)
⋮ (188)
𝑥𝑛 = 𝑥𝑛 (𝑞1 , 𝑞2 , … , 𝑞𝑁 ). (189)
Concatening all the maximal and generalized coordinates, we denote this 𝐱 = 𝐱(𝐪). In general,
Equations (186)-(189) may also depend on time, but for simplicity we do not consider that case
here. See [Murray et al. 1986; Lanczos 2012] for further details.
These expressions can be used to define the kinetic energy and potential energy of the system in
terms of the 𝐪 and 𝐪̇ , the generalized velocity. The velocity of the system is
𝜕𝐱
̇ =
𝐱(𝑡) ̇
𝐪. (190)
𝜕𝐪
Let 𝐽 (𝐪) = 𝜕𝐱
𝜕𝐪 be the Jacobian of the coordinate functions. The kinetic energy is given by
1 1 1
𝑇 = 𝐱̇ 𝑇 𝑀 𝐱̇ = (𝐽 𝐪)
̇ 𝑇 𝑀 𝐽 ̇𝐪̇ = 𝐪̇ 𝑇 𝐽 𝑇 𝑀𝐽 𝐪.
̇ (191)
2 2 2
Analogous to the force in the system of maximal coordinates, we can define generalized forces
for the system of generalized coordinates. For example, for a rigid body the generalized forces are
the six components of the force and torque and on the body. As described in detail in [Lanczos
2012], two sets of forces for two sets of coordinates will induce equivalent dynamics if they do
the same virtual work on a virtual displacement consistent with the constraints. Therefore, the
generalized forces for any system can be easily found by equating the virtual work done by both
sets of forces on virtual displacements consistent with the constraints as
𝐅 ⋅ 𝛿𝐱 = 𝐆 ⋅ 𝛿𝐪, (192)
where we have used 𝐆 ∈ ℝ𝑁 to represent the generalized forces. The displacements 𝛿𝐱 are required
to be consistent with the constraints, so 𝛿𝐱 = 𝐽 𝛿𝐪. Using this, we get
𝐅𝑇 𝛿𝐱 = 𝐆𝑇 𝛿𝐪 (193)
𝐅𝑇 𝐽 𝛿𝐪 = 𝐆𝑇 𝛿𝐪 (194)
The coordinates 𝛿𝐪 are unconstrained and so are arbitrary. This means we must have
𝐅𝑇 𝐽 = 𝐆𝑇 , or 𝐆 = 𝐽 𝑇 𝐅. (195)
46
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
We can verify this result in the case of a rigid body, where the velocity of a particle is
𝐯
𝐱̇ = (𝐼 𝐫∗𝑇 ) , (196)
(𝝎 )
so 𝐽 = (𝐼 𝐫∗𝑇 ). A force 𝐅 applied to the particle results in a generalized force on the body
𝐼 𝐅
𝐆 = 𝐽𝑇𝐅 = 𝐅= , (197)
(𝐫 ∗ ) (𝐫 × 𝐅)
which are the familiar expressions for force and torque.
The Lagrange equations of motion, analogous to Newton’s second law, can be written as
𝑑 𝜕𝑇
= 𝐆, (198)
𝑑𝑡 ( 𝜕 𝐪̇ )
where 𝐺 are the generalized forces. For conservative forces, we can define the Lagrangian, 𝐿 = 𝑇 −𝑉 ,
where 𝑉 is the potential energy associated with the forces, and express the above as the Euler-
Lagrange equations
𝑑 𝜕𝐿 𝜕𝐿
− = 𝟎. (199)
𝑑𝑡 ( 𝜕 𝐪̇ ) 𝜕𝐪
Additional generalized forces accounting for non-conservative forces or constraint forces not
respected by the generalized coordinates can be included on the right hand side of the Euler-
Lagrange equations.
As an example we consider the pendulum in two dimensions illustrated in the figure below. A
single particle of mass 𝑚 with maximal coordinates 𝐱 = (𝑥, 𝑦) is suspended at a length 𝑙 . Although
𝐱 has two coordinates, the system has only one degree of freedom due to the constraint imposed
by the pendulum. We use the angle of pendulum with the vertical, 𝜃 , as the generalized coordinate.
With the origin at the attachment point, the maximal coordinates are
𝑥(𝜃) = 𝑙 sin 𝜃 (200)
𝑦(𝜃) = −𝑙 cos 𝜃 (201)
The velocity is
̇
𝑥(𝜃) 𝑙 cos 𝜃 𝜃̇
= = 𝐽 𝜃.̇ (202)
̇ )
(𝑦(𝜃) ( 𝑙 sin 𝜃 𝜃̇ )
The kinetic energy is
1 1
𝑇 = 𝑚(𝑥̇ 2 + 𝑦̇ 2 ) = 𝑚𝑙 2 𝜃̇ 2 .
2 2
We have
𝜕𝑇
= 𝑚𝑙 2 𝜃,̇
𝜕 𝜃̇
47
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
and thus
𝑑 𝜕𝑇
= 𝑚𝑙 2 𝜃.̈ (203)
𝑑𝑡 ( 𝜕 𝜃̇ )
The only force we need to explicitly account for is gravity, given in maximal coordinates as
(0, −𝑚𝑔)𝑇 . The generalized force is therefore
0 0
𝐽𝑇 = (𝑙 cos 𝜃 𝑙 sin 𝜃 ) = −𝑙𝑚𝑔 sin 𝜃. (204)
(−𝑚𝑔 ) (−𝑚𝑔 )
Putting together Equations (203) and (204), we get
𝑚𝑙 2 𝜃̈ = −𝑙𝑚𝑔 sin 𝜃,
or the well-known equations of motion for a pendulum
𝑔
𝜃̈ + sin 𝜃 = 0.
𝑙
48
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
49
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
Fig. 11. A convex polygon is one that fully contains the line segment joining any two points in the
polygon. The polygon on the left is nonconvex, while the polygon on the right is convex.
for some tunable parameter 𝛾 . When the position-level constraint 𝐠(𝐱) = 0 is already satisfied, this
will result in the same equation as before. If there is error in the position constraint, the computed
velocities will drive the error to zero.
Many practical rigid body systems (e.g., Bullet [Coumans 2010], ODE [Smith et al. 2005], and
Box2D [Catto 2011a]) add compliance to hard constraints by replacing 𝐽 𝐯 = 0 with
𝛽
𝐽𝐯 + 𝐠(𝐱) + 𝛾 𝝀 = 0, (213)
Δ𝑡
for constants 𝛽 and 𝛾 [Catto 2011b]. The linear system (209) then becomes
𝑀 −𝐽 𝑇 𝐕𝑛+1 𝑀𝐕𝑛 + Δ𝑡𝐅
𝑛+1 = 𝛽 . (214)
(−𝐽 𝛾 𝐼 ) ( 𝝁 ) ( − Δ𝑡 𝐠(𝐗𝑛 ) )
This makes the constraint a bit softer, while countering drift. Furthermore, Eq. (214) is easier
to solve numerically as the new diagonal block regularizes the equations, which may become
poorly conditioned in the case of redundant or nearly redundant constraints. See also [Catto 2011b;
Tournier et al. 2015; Lacoursiere 2007] for further details.
5.5 Collisions
Dynamic scenarios with many rigid or deformable solids will typically lead to many collisions
and contacts between objects. Soft bodies also experience self-collision, where one part of the
body deforms and collides with another part of the body. Cloth simulations in particular can
undergo many simultaneous self-collisions that can be challenging to resolve. In all of these cases,
a significant part of the computational cost of a solver is in detecting and resolving collisions and
contacts.
Collision detection. Before collisions can be resolved, they must first be detected by checking
for interpenetration of object geometry. Collision detection algorithms make use of a variety of
geometric representations.
Polygonal geometry is commonly used to represent both rigid and deformable bodies. Many
algorithms have been developed for finding intersections of polytopes, particularly convex polytopes
(illustrated above). The Separating Axis Theorem says that if a separating hyperplane can be found
between two convex shapes, they are disjoint and hence do not intersect. Faces of potentially
colliding geometry are natural candidates for separating hyperplanes. Convex decompositions are
often computed for nonconvex bodies for collision detection purposes. When using polygonal
geometry, various intersection cases must be considered, such as point-face intersections and
edge-edge intersections.
50
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
Fig. 12. Left and middle: Three-dimensional dragon model and two-dimensional slice of its signed
distance field. Right: Signed distance field for a circle. The vertices of a polygonal shape, illustrated in
white, can be efficiently tested against the signed distance field to detect the interpenetration.
Another geometric representation commonly used in collision detection is the signed distance
field. The signed distance field 𝜙(𝐱) of an object assigns to each point in space 𝐱 the signed distance
from 𝐱 to the nearest point on the surface of the object. Points inside the object will have 𝜙 < 0
while points outside have 𝜙 > 0, or the other way around depending on the convention used. The
surface is then implicitly defined as the zero level set of 𝜙 , the points 𝐱 such that 𝜙(𝐱) = 0. Typically
𝜙 will be sampled on a structured grid containing the object. Surface points 𝐩 from other objects
can query 𝜙(𝐩) to determine in constant time whether they are inside or outside the object, as
illustrated in the figure below. Though inside/outside tests are fast, with many objects there can be
significant memory overhead in storing the distance fields. Also, while 𝜙 can be computed once
for rigid bodies in a preprocessing step, for deformable geometry it may need to be recomputed
intermittently. Another advantage of a signed distance representation is that the surface normals
needed for collision and contact resolution can be readily computed from the signed distance field
since 𝐧(𝐱) = ∇𝜙(𝐱).
For 𝑛 objects, there are 𝑂(𝑛2 ) pairs of objects. To make collision detection practical in simulations
with many interacting objects, acceleration structures must be employed. A common approach
is to create bounding volumes for the geometry, specifically volumes for which intersection tests
can be made very fast. The bounding volumes are then used to quickly prune the set of possible
intersections, since two objects do not intersect if their bounding volumes do not intersect. Spheres,
axis-aliged bounding boxes, and oriented bounding boxes are commonly used. Furthermore, hi-
erarchical bounding volumes can computed, potentially allowing for more efficient culling of a
large number of candidate intersections. In addition to bounding volumes, spatial partitions can
accelerate collision detection by indicating which objects are simultaneously present in a particular
region of space. The must be updated throughout the simulation as the objects evolve.
In discrete collision detection we consider the geometric state of objects in the scene at a fixed
instant in time, ignoring their trajectories. For large volumetric objects this is often sufficient.
However, thin objects such as cloth, or very small objects could experience intersections during a
time step that would not be evident when looking at a fixed instant of time at the beginning or
end of the time step. For example, a small object thrown at a piece of cloth could be fully on one
side of the cloth at the start of the time step and fully on the other side at the end of the time step.
However, between the two instants of time the object passed through the cloth, so in principle
a collision should be detected and resolved. Continuous collision detection takes into account the
trajectory of motion over the time step when checking for intersections. Analytical methods for
solving the intersection problem exist in some cases. Ray casting and numerical solvers are also
used. This is harder and more computationally intensive than discrete collision detection and some
systems may avoid continuous collision detection by limiting time steps.
51
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
Collision response (1D). In collision response, the solver resolves a previously detected colli-
sion, typically by computing and applying a pair of impulses to the colliding bodies so that their
updated velocities are valid. Let us consider a simple example where two particles in one dimension
with masses 𝑚1 , 𝑚2 and velocities 𝑣1 , 𝑣2 collide, as illustrated below. By Newton’s third law, they
will exert equal and opposite forces on each other. The collision is instantaneous, so we find a pair
of impulses ±𝑗 that effect the change in momenta of the particles. Let 𝑣1′ and 𝑣2′ be the velocities of
the particles after the collision. We add impulses 𝑗 and −𝑗 to the system as
𝑚1 𝑣1′ = 𝑚1 𝑣1 + 𝑗 (215)
𝑚2 𝑣2′ = 𝑚2 𝑣2 − 𝑗, (216)
and require that the collision be inelastic, or sticking, which means that after the collision the
particles travel together, i.e.,
𝑣1′ = 𝑣2′ . (217)
We now have three equations and three unknowns. We solve for 𝑣1′ and 𝑣2′ in Equations (215) and
(216) and plug the expressions into Eq. (217) to get
1 1
(𝑚 𝑣 + 𝑗) = (𝑚 𝑣 − 𝑗). (218)
𝑚1 1 1 𝑚2 2 2
We can now solve for 𝑗 :
1 1
+ 𝑗 = 𝑣2 − 𝑣1 (219)
( 𝑚1 𝑚2 )
1 1 −1
⇒𝑗= + (𝑣2 − 𝑣1 ). (220)
( 𝑚1 𝑚2 )
For example, if 𝑣1 = 𝑣 , 𝑣2 = −𝑣 , and 𝑚1 = 𝑚2 = 𝑚, then the above tells us that 𝑗 = −𝑚𝑣 and
after the collision 𝑣1′ = 𝑣2′ = 0. If 𝑣1 = 𝑣 , 𝑣2 = −𝑣 , and 𝑚1 = 3, 𝑚2 = 1, then after the collision
𝑣1′ = 𝑣2′ = 12 𝑣 , so that the particles continue to travel together in the direction that the more
massive particle was traveling, with reduced speed.
It is also common to employ elastic collisions, especially in rigid body simulation. In that case,
instead of being zero, the relative velocity of the particles after collision is given by
(𝑣2′ − 𝑣1′ ) = −𝜖(𝑣2 − 𝑣1 ), (221)
where 𝜖 ∈ [0, 1] is the coefficient of restitution. Note that 𝜖 = 0 gives the inelastic case above.
Substituting the expressions for 𝑣1′ and 𝑣2′ from Eqs. (215) and (216) as before, and solving for 𝑗 we
get
1 1 −1
𝑗= + (1 + 𝜖)(𝑣2 − 𝑣1 ). (222)
( 𝑚1 𝑚2 )
For example, if 𝑣1 = 𝑣 , 𝑣2 = −𝑣 , and 𝑚1 = 𝑚2 = 𝑚, then for a perfectly elastic collision with 𝜖 = 1,
𝑗 = −2𝑚𝑣 , and 𝑣1′ = −𝑣 , 𝑣2′ = 𝑣 .
52
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
Deformable object collisions. Physically, the bounce resulting from a collision occurs due to
deformation of the colliding objects in some region around the collision. As the bodies collide,
they compress, and elastic energy is stored. The release of the energy results in the rebound
seen following the collision. Therefore, for deformable objects, one can use the inelastic collision
equations described above. The one-dimensional case generalizes straightforwardly to two or three
dimensions to give
𝑚1 𝐯′1 = 𝑚1 𝐯1 + 𝐣 (223)
𝑚2 𝐯′2 = 𝑚2 𝐯2 − 𝐣 (224)
𝐯′2 = 𝐯′1 , (225)
for a total of six equations and unknowns in two dimensions, or nine equations and unknowns
in three dimensions. The velocities are measured at the point of collision, and the impulses are
applied at the point of collision. As the objects deform, there may be many points of collision.
Rigid body collisions. For rigid bodies the situation is somewhat different than for deformable
bodies. Physically, such objects will also undergo deformation in a collision in the process described
above for deformable bodies. But given the rigid body idealization which prohibits any deformation,
a different approach is needed to model rigid body collisions. Typically, collision laws are used
to relate quantities before and after the collision [Chatterjee and Ruina 1998]. These are derived
similarly to the above derivations, but consider also the angular components of velocity and
momentum. The treatment of friction in the tangential directions of motion significantly complicates
rigid body collisions. We first consider the simpler cases of sticking and frictionless collisions.
Following [Ruina and Pratap 2009], we consider the collision of two rigid bodies with masses 𝑚1 ,
𝑚2 , inertia tensors 𝐼1 , 𝐼2 , linear velocities 𝐯1 , 𝐯2 , and angular velocities 𝝎 1 , 𝝎 2 . The velocities after
collision are denoted with a prime as before. The scenario is illustrated below. The figure identifies
a plane tangent to the bodies at the time of collision, with 𝐧 a unit normal the plane.
We write the linear momenta of the bodies before and after the collision,
𝑚1 𝐯′𝐶1 = 𝑚1 𝐯𝐶1 + 𝐣 (226)
𝑚2 𝐯′𝐶2 = 𝑚2 𝐯𝐶2 − 𝐣, (227)
53
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
and the angular momenta of the bodies before and and after collisions as
𝐼1 𝝎 ′1 = 𝐼1 𝝎 1 + 𝐫1 × 𝐣, (228)
𝐼2 𝝎 ′2 = 𝐼2 𝝎 1 − 𝐫2 × 𝐣. (229)
For a sticking collisions, the remaining equations state that the objects move at the same velocity
at the point of contact immediately following the collision:
𝐯′𝑃1 = 𝐯′𝑃2 , (230)
where
𝐯′𝑃1 = 𝐯′𝐶1 + 𝝎 ′1 × 𝐫1 , (231)
𝐯′𝑃2 = 𝐯′𝐶2 + 𝝎 ′2 × 𝐫2 (232)
are the velocities of the first and second body, respectively, at the collision point. The number of
equations/unknowns in (226)-(230) are eight in two dimensions and fifteen in three dimensions.
For a frictionless elastic collision, we assume
𝐣 = 𝑗𝐧, (233)
and replace Eq. (230) with a condition on the normal component of the relative velocities after
collisions, analogous to Eq. (221):
(𝐯′𝑃2 − 𝐯′𝑃1 ) ⋅ 𝐧 = −𝜖(𝐯𝑃2 − 𝐯𝑃1 ) ⋅ 𝐧, (234)
where 𝜖 ∈ [0, 1]. Given the linear and angular velocities of the bodies before the collision and the
collision plane at collision, these equations can be solved to determine the normal impulse and the
velocities of the bodies after the collision.
Frictional collisions. In frictional collisions, the impulse 𝐣 consists of both a normal component
and a tangential component that prevents or damps the relative tangential velocities of the bodies
at the point of collision.
We first describe the Coulomb friction model, which is an empirical model describing the frictional
forces that arise in sticking or sliding contact. According to the Coulomb friction model, the
magnitude of the tangential force cannot exceed 𝜇 ‖𝐟 𝑛 ‖, but may be less if the contact point is
sticking. The direction of the tangential force is directly opposing the tangential direction of motion.
The coefficient 𝜇 is called the coefficient of friction. When the contact is sliding, the tangential
force is at its maximum possible value, and is equal to
𝐟 𝑡 = −𝜇 ‖𝐟 𝑛 ‖𝐭,
where 𝐭 is the direction of motion. When the contact is sticking, the tangential force is just enough
to counteract other tangential forces. This is summarized in this plot, adapted from [Ruina and
Pratap 2009]: When the relative velocity at the contact point is positive, the frictional force is −𝜇𝑓𝑛 𝐭.
When the relative motion is negative, the frictional force is 𝜇𝑓𝑛 𝐭. When the relative velocity is zero,
the frictional force is between these two values.
The restrictions on the forces or impulses in the Coulomb friction model can be illustrated by
the friction cone, defined by the inequality
‖𝐟 𝑡 ‖ ≤ 𝜇 ‖𝐟 𝑛 ‖,
and shown here.
54
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
In [Guendelman et al. 2003], tangential frictional impulses were included in rigid body collisions
by first assuming sticking in the tangential direction, as
and solving this along with Eqs. (226)-(229) and (234). If the solution 𝐣 is in the friction cone, then
the sticking assumption is admissible and the impulse 𝐣 is used. If 𝐣 is not in the friction cone, then
sliding friction is applied. In practice, algebraic collision laws such as this one can give rise to some
nonphysical results. A detailed analysis of several collision laws is given in [Chatterjee and Ruina
1998].
REFERENCES
[Baraff 1996] David Baraff. 1996. Linear-time dynamics using Lagrange multipliers. In Proceedings
of the 23rd annual conference on Computer graphics and interactive techniques. ACM, 137–146.
[Baraff 2001] David Baraff. 2001. Physically based modeling: Rigid body simulation. SIGGRAPH
Course Notes, ACM SIGGRAPH 2, 1 (2001), 2–1.
[Baumgarte 1972] Joachim Baumgarte. 1972. Stabilization of constraints and integrals of motion in
dynamical systems. Computer methods in applied mechanics and engineering 1, 1 (1972), 1–16.
[Bender et al. 2014] Jan Bender, Kenny Erleben, and Jeff Trinkle. 2014. Interactive simulation of
rigid body dynamics in computer graphics. In Computer Graphics Forum, Vol. 33. Wiley Online
Library, 246–270.
[Bridson 2015] Robert Bridson. 2015. Fluid simulation for computer graphics. AK Peters/CRC Press.
[Catto 2011a] Erin Catto. 2011a. Box2d: A 2d physics engine for games. http://box2d.org/
[Catto 2011b] Erin Catto. 2011b. Soft Constraints: Reinventing the Spring. http://box2d.org/files/
GDC2011/GDC2011_Catto_Erin_Soft_Constraints.pdf
55
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
[Catto 2014] Erin Catto. 2014. Physics for Game Programmers: Understanding Constraints. https:
//www.youtube.com/watch?v=SHinxAhv1ZE
[Chatterjee and Ruina 1998] Anindya Chatterjee and Andy Ruina. 1998. A new algebraic rigid-body
collision law based on impulse space considerations. Journal of Applied Mechanics 65, 4 (1998),
939–951.
[Coumans 2010] Erwin Coumans. 2010. Bullet physics engine. Open Source Software:
http://bulletphysics. org 1 (2010), 3.
[Drumwright 2008] Evan Drumwright. 2008. A fast and stable penalty method for rigid body
simulation. IEEE Transactions on Visualization and Computer Graphics 14, 1 (2008), 231–240.
[Faure et al. 2008] François Faure, Sébastien Barbier, Jérémie Allard, and Florent Falipou. 2008.
Image-based collision detection and response between arbitrary volume objects. In Proceedings
of the 2008 ACM SIGGRAPH/Eurographics Symposium on Computer Animation. Eurographics
Association, 155–162.
[Featherstone 1983] Roy Featherstone. 1983. The calculation of robot dynamics using articulated-
body inertias. The International Journal of Robotics Research 2, 1 (1983), 13–30.
[Floater 2003] Michael S. Floater. 2003. Mean Value Coordinates. Comput. Aided Geom. Des. 20, 1
(March 2003), 19–27. https://doi.org/10.1016/S0167-8396(02)00002-5
[Guendelman et al. 2003] Eran Guendelman, Robert Bridson, and Ronald Fedkiw. 2003. Nonconvex
rigid bodies with stacking. In ACM Transactions on Graphics (TOG), Vol. 22. ACM, 871–878.
[Harlow and Welch 1965] Francis H. Harlow and J. Eddie Welch. 1965. Numerical Calculation of
Time-Dependent Viscous Incompressible Flow of Fluid with Free Surface. Physics of Fluids 8, 12
(1965), 2182–2189. https://doi.org/10.1063/1.1761178
[Harmon et al. 2009] David Harmon, Etienne Vouga, Breannan Smith, Rasmus Tamstorf, and Eitan
Grinspun. 2009. Asynchronous contact mechanics. ACM Transactions on Graphics (TOG) 28, 3
(2009), 87.
[Heath 2002] Michael T Heath. 2002. Scientific computing. McGraw-Hill New York.
[Jacobson et al. 2011] Alec Jacobson, Ilya Baran, Jovan Popović, and Olga Sorkine. 2011. Bounded
Biharmonic Weights for Real-time Deformation. ACM Trans. Graph. 30, 4, Article 78 (July 2011),
8 pages. https://doi.org/10.1145/2010324.1964973
[Jones et al. 2016] Ben Jones, Nils Thuerey, Tamar Shinar, and Adam W Bargteil. 2016. Example-
based plastic deformation of rigid bodies. ACM Transactions on Graphics (TOG) 35, 4 (2016),
34.
[Joshi et al. 2007] Pushkar Joshi, Mark Meyer, Tony DeRose, Brian Green, and Tom Sanocki. 2007.
Harmonic coordinates for character articulation. In ACM Transactions on Graphics (TOG), Vol. 26.
ACM, 71.
[Ju et al. 2005] Tao Ju, Scott Schaefer, and Joe Warren. 2005. Mean Value Coordinates for Closed
Triangular Meshes. ACM Trans. Graph. 24, 3 (July 2005), 561–566. https://doi.org/10.1145/
1073204.1073229
[Lacoursiere 2007] Claude Lacoursiere. 2007. Ghosts and machines: regularized variational meth-
ods for interactive simulations of multibodies with dry frictional contacts. Ph.D. Dissertation.
Datavetenskap.
[Lanczos 2012] Cornelius Lanczos. 2012. The variational principles of mechanics. Courier Corpora-
tion.
[Landau and Lifshitz 1959] LD Landau and EM Lifshitz. 1959. Course of theoretical physics. vol. 6:
Fluid mechanics. London.
[Lipman et al. 2008] Yaron Lipman, David Levin, and Daniel Cohen-Or. 2008. Green coordinates.
ACM Transactions on Graphics (TOG) 27, 3 (2008), 78.
56
An Introduction to Physics-based Animation A. Bargteil and T. Shinar.
[Marschner and Shirley 2015] Steve Marschner and Peter Shirley. 2015. Fundamentals of computer
graphics. CRC Press.
[Mirtich 1996] Brian Vincent Mirtich. 1996. Impulse-based dynamic simulation of rigid body systems.
Citeseer.
[Murray et al. 1986] R Murray, R Murray, and Spiegal. 1986. Theory and Problem of Theoretical
Mechanics. Shaum’s Outline Series.
[Museth 2013] Ken Museth. 2013. VDB: High-resolution Sparse Volumes with Dynamic Topology.
ACM Trans. Graph. 32, 3, Article 27 (July 2013), 22 pages. https://doi.org/10.1145/2487228.2487235
[Ruina and Pratap 2009] Andy L Ruina and Rudra Pratap. 2009. Introduction to statics and dynamics.
Pre-print for Oxford University Press. http://ruina.tam.cornell.edu/Book/RuinaPratap1-31-11.pdf
[Shen et al. 2005] Chen Shen, James F O’Brien, and Jonathan R Shewchuk. 2005. Interpolating and
approximating implicit surfaces from polygon soup. In ACM Siggraph 2005 Courses. ACM, 204.
[Shinar et al. 2008] Tamar Shinar, Craig Schroeder, and Ronald Fedkiw. 2008. Two-way coupling of
rigid and deformable bodies. In Proceedings of the 2008 ACM SIGGRAPH/Eurographics Symposium
on Computer Animation. Eurographics Association, 95–103.
[Sifakis et al. 2007] Eftychios Sifakis, Tamar Shinar, Geoffrey Irving, and Ronald Fedkiw. 2007.
Hybrid simulation of deformable solids. In Proceedings of the 2007 ACM SIGGRAPH/Eurographics
symposium on Computer animation. Eurographics Association, 81–90.
[Sims 1990] Karl Sims. 1990. Particle Animation and Rendering Using Data Parallel Computation.
SIGGRAPH Comput. Graph. 24, 4 (Sept. 1990), 405–413. https://doi.org/10.1145/97880.97923
[Smith et al. 2005] Russell Smith et al. 2005. Open dynamics engine. (2005).
[Tang et al. 2012] Min Tang, Dinesh Manocha, Miguel A Otaduy, and Ruofeng Tong. 2012. Contin-
uous penalty forces. ACM Trans. Graph. 31, 4 (2012), 107–1.
[Tournier et al. 2015] Maxime Tournier, Matthieu Nesme, Benjamin Gilles, and François Faure. 2015.
Stable constrained dynamics. ACM Transactions on Graphics (TOG) 34, 4 (2015), 132.
[Weinstein et al. 2006] Rachel Weinstein, Joseph Teran, and Ronald Fedkiw. 2006. Dynamic
simulation of articulated rigid bodies with contact and collision. IEEE Transactions on Visualization
and Computer Graphics 12, 3 (2006), 365–374.
[Witkin 2001] Andrew Witkin. 2001. Physically Based Modeling–Constraint Dynamics. ACM
SIGGRAPH 2001 Course Notes (2001).
[Xu et al. 2014] Hongyi Xu, Yili Zhao, and Jernej Barbic. 2014. Implicit multibody penalty-
baseddistributed contact. IEEE Transactions on Visualization & Computer Graphics 9 (2014),
1266–1279.
57