1 1 M Teschner - Deformable Modeling ETH Zurich Modeling Dynamic Deformation with Mass Points and Springs Matthias Teschner Seminar – Wintersemester 02/03 Movie 2 M Teschner - Deformable Modeling ETH Zurich Deformable Objects deformable mass-spring system 1. Discretization of an object into mass points 2. Representation of forces between mass points with springs 3. Computation of the dynamics Movie Movie Teschner 3 M Teschner - Deformable Modeling ETH Zurich Outline Motivation Model Components Mass Points Springs Forces Computation of the Dynamic Behavior Explicit Numerical Integration Implicit Numerical Integration Higher-Order Numerical Integration Stability and Performance Aspects Performance Time and Space Adaptive Sampling Damping Force-Deformation Relationship Model Topology 4 M Teschner - Deformable Modeling ETH Zurich Virtual Clothing • Simulation of cloth based on deformable surfaces (polygonal mesh) • Realistic simulation of cloth with different fabrics such as wool, cotton or silk for garment design Thalmann Strasser Baraff
17
Embed
Outline - CGL @ ETHZ...Seminar – Wintersemester 02/03 Movie 2 M Teschner - Deformable Modeling ETH Zurich Deformable Objects deformable mass-spring system 1. Discretization of an
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
1M Teschner - Deformable Modeling
ETH Zurich
Modeling Dynamic Deformationwith Mass Points and Springs
Matthias TeschnerSeminar – Wintersemester 02/03
Movie
2M Teschner - Deformable Modeling
ETH ZurichDeformable Objects
deformable mass-spring system
1. Discretization of an object into mass points
2. Representation of forces between mass points with springs
3. Computation of the dynamics
Movie
Movie
Teschner
3M Teschner - Deformable Modeling
ETH ZurichOutline
MotivationModel Components
Mass PointsSpringsForces
Computation of the Dynamic BehaviorExplicit Numerical IntegrationImplicit Numerical IntegrationHigher-Order Numerical Integration
Stability and Performance AspectsPerformanceTime and Space Adaptive SamplingDampingForce-Deformation RelationshipModel Topology
4M Teschner - Deformable Modeling
ETH ZurichVirtual Clothing
• Simulation of cloth based ondeformable surfaces(polygonal mesh)
• Realistic simulation of cloth withdifferent fabrics such as wool,cotton or silk for garment design
Thalmann
Strasser
Baraff
2
6M Teschner - Deformable Modeling
ETH ZurichVirtual Clothing
ChoiSeoul National University
7M Teschner - Deformable Modeling
ETH ZurichFacial Animation
• Simulation of facial expressions based on• deformable surfaces• deformable volumes• muscles
• Animation of face models from speechand mimic parameters
Terzopoulos
Thalmann
8M Teschner - Deformable Modeling
ETH ZurichMedical Simulation
• Simulation of deformable soft tissue• Surgical planning• Medical training• Swiss NCCR Co-Me www.co-me.ch
Prediction of the surgical outcomein craniofacial surgery
Computation of the Dynamic BehaviorExplicit Numerical IntegrationImplicit Numerical IntegrationHigher-Order Numerical Integration
Stability and Performance AspectsTime and Space Adaptive SamplingDampingForce-Deformation RelationshipModel Topology
Outline
19M Teschner - Deformable Modeling
ETH ZurichStatic Equilibrium
System of mass points ( )TxxX 10,=
( )( )0101
01int0 xx
xx
xxF −
−−−
=L
kL
0x
1x
( ) ( )
( ) ( )
−−−
−−−
−
−−−
−−
−−
−=−1
0
01
01
01
01
01
01
01
01
x
x
xx
xx
xx
xxxx
xx
xx
xx
KXL
kL
k
Lk
Lk
extint FKXF =−=Static Equilibrium:
5
20M Teschner - Deformable Modeling
ETH ZurichFrom Statics to Dynamics
Motion equation for a system of mass points
( ) ( ) ( )t(t)dt
td
dt
td extFKXX
DX
M +=+2
2
extFKX =− ( )t(t) extFKX +=0
Consideration of dynamics
( ) ( )t(t)dt
td extFKXX
M +=2
2
Incorporation of damping
21M Teschner - Deformable Modeling
ETH ZurichMass-Point Dynamics
( ) ( )i
ii Fxx =+dt
td
dt
tdmi γ
2
2
Motion equation for mass point at time point i t
• second-order differential equation• Newton’s equation or motion equation in Langrange form• force F is used for acceleration and damping • simplified form ma = F if damping is neglected
mass position dampingcoefficient force at mass point
• Compute spring forces • Add external forces• Compute auxiliary positions and velocities
• requires additional copies of data• once for second-order• three times for fourth-order
• Update positions• Update velocities
39M Teschner - Deformable Modeling
ETH ZurichImplicit Integration – Theta Scheme
NicolsonCrank
Eulerimplicit
Eulerexlicit
:5.0
:1
:0
===
θθθ
( ))1()()1()()1( +⋅+⋅−+=+ tthtt vvxx θθ
( ))1()()1()()1( +⋅+⋅−+⋅=+⋅ tthtmtm FFvv θθ
40M Teschner - Deformable Modeling
ETH ZurichTheta Scheme - Implementation
2
)2
)()()(())((
)()(
htthtt
htmhtm
++⋅++⋅+⋅=+⋅
vvxFxF
vv
2
)()()())(()
2
)()()((
)(
httht
httht
t
++⋅⋅∂
∂+≈++⋅+=
vv
x
xFxF
vvxF
xx
)(
2 )(
2
)())(()(
t
ththtm
xxx
xFvxFv
=∂∂⋅⋅+⋅+⋅
∂∂⋅−
= )(
2 )(
2 t
hm
xxx
xF ≈+⋅ )( htv
rewriting the problem
linearization of force
explicit form for v(t+h)
9
41M Teschner - Deformable Modeling
ETH ZurichTheta Scheme – Conjugate Gradient
• linear system:
• gradient of a function
with
• iterative solution for v with initial value v0
Iteration:
A =⋅v b
bvAv −⋅=∇ )(f
0)( =∇ vf
))((1 kkk fw vvv ∇⋅+=+ α
42M Teschner - Deformable Modeling
ETH ZurichHigher-Order Numerical Integration
Integration methods for first-order ODE’s
EulerHeunRunge Kutta
commonly used in Computer Graphics applications
Integration methods for Newton’s motion equation
VerletVelocity VerletBeeman
commonly used in molecular dynamics
43M Teschner - Deformable Modeling
ETH ZurichVerlet Integration
)()(6
)(2
)(')()(
)()(6
)(2
)(')()(
432
432
hOt'''h
th
ththt
hOt'''h
th
ththt
+−+−=−
++++=+
xaxxx
xaxxx
+
=)()()()(2)( 42 hOthhttht ++−+=+ axxx
)(2
)()()( 2hO
h
hthttv +−−+= xx
44M Teschner - Deformable Modeling
ETH Zurich
( ) ( ) ( ) ( ) ( )( )htfahtfatfaaaa
htfhtf 2''' 030201
32100 −+−+
+++=+
Other Integration Techniques
Burlisch-Stoer Methods
Predictor-Corrector Methods
• Polynomial function extrapolation based on midpoint method steps• High accuracy with minimal computational effort• Bad for non-smooth functions• Not very promising, but has been used for mass-spring models
• Predicts a value from previous derivatives
• Corrects the value using the derivative from the predicted value (implicit)
( ) ( ) ( ) ( ) ( )( )htfbtfbhtfbbbb
htfhtf −+++
+++=+ 030201
32100 '''
10
45M Teschner - Deformable Modeling
ETH ZurichNumerical Integration - Summary
Motion equation for mass point• second-order differential equation• coupled system of first-order differential equation• derivatives of velocity v and position x are described
Numerical integration• known initial values at a certain time t for v and x• approximative integration of v and x through time• time step hIntegration techniques• Euler, Leap-Frog• Runge-Kutta• Crank-Nicolson• Verlet, velocity Verlet, Beeman• predictor-corrector• methods differ in accuracy and computational complexity• size of time step h is trade-off between performance and robustness
46M Teschner - Deformable Modeling
ETH Zurich
MotivationModel Components
Mass PointsSpringsForces
Computation of the Dynamic BehaviorExplicit Numerical IntegrationImplicit Numerical IntegrationHigher-Order Numerical Integration
Stability and Performance AspectsPerformanceTime and Space Adaptive SamplingDampingForce-Deformation RelationshipModel Topology
Outline
47M Teschner - Deformable Modeling
ETH ZurichHow to Measure Performance ?
• Frames per second (System updates per real-life second)
• Commonly used• How many mass points?• How many springs?• Computational expenses for external forces?• Other expenses like collision handling and rendering?• Which numerical integration technique?• What time step?
• Example: 0.1 – 1 s for 10,000 polygons per iteration using various integration techniques [Volino/Thalmann 2001]cloth simulation
It is difficult !
48M Teschner - Deformable Modeling
ETH ZurichComparison of Integration Methods
• Synthetic object under gravity• 22320 springs (16875 tetras) Method time step comp. time ratio
• Numerical integration time step 5 ms• Computational time 1.8 ms• Performed tasks in a simulation environment per second
• 450 integrations a 1.8 ms• 450 collision handlings a 0.2 ms • 23 visualizations a 1.7 ms
1349 mass points6888 springs
Uterus
50M Teschner - Deformable Modeling
ETH ZurichPerformance - Example
Vessel
• Numerical integration time step 1.9 ms• Computational time 6.1 ms• Performed tasks in a simulation environment per second
• 135 integrations a 6.1 ms• 135 collision handlings a 1.1 ms • 7 visualizations a 3.7 ms
2949 mass points15713 springs
51M Teschner - Deformable Modeling
ETH ZurichAdaptive Time Steps
• Minimizing computational expensesby adaptively choosing time steps
• Small time steps if forces at mass points change significantly• Larger time steps if forces do not change much• Computational overhead for tracking force changes• Example:
• Free falling sphere does not require small time steps.• Any collision would require smaller time steps.• Early detection of force changes necessary.
t
f(t)
52M Teschner - Deformable Modeling
ETH ZurichSpace Adaptive Sampling
Debunne
• Hierarchical model representation (coarse sampling to fine sampling)• Different numbers of mass points for different modeling accuracies• Allows to focus the computational load on interesting regions • Problem: How to define regions of interest• Problem: Relation between simulated mass points and object points
12
53M Teschner - Deformable Modeling
ETH ZurichSpace Adaptive Sampling
• Combination of physically-based and geometric deformation
• Different degrees of freedom for deformation
surface/object points
mass point
• Definition of rules to switch between level of details in certain areas• Update of the relation between mass points and surface points.
54M Teschner - Deformable Modeling
ETH ZurichSpace Adaptive Sampling
DebunneDesbrunCotiBarr
55M Teschner - Deformable Modeling
ETH ZurichDamping
• Models the real fact, that friction costs energy• Smoothens variations in velocities and positions of mass points• Reduces instability risk
Damping is a force usually linear proportional to vn in opposite direction
• Coulomb F~v0 not applied for mass-spring systems
• Stokes F~v uniform damping, preferred
• Newton F~v2 non-uniform damping
It is not intended to bound velocities and positions! Not the magnitude, but variations influence the stability!
56M Teschner - Deformable Modeling
ETH ZurichPoint Damping
( ) ( )i
ii Fxx =+dt
td
dt
tdmi γ
2
2
( ) ( ) ( )im
tt
dt
td iii vFv γ−=
• Force at a point is usedfor acceleration and damping
• Damping force is applied in oppositedirection to the velocity of the point
• Example: Falling mass point has a maximum speed, when gravity and damping are in an equilibrium
damping force
13
58M Teschner - Deformable Modeling
ETH ZurichSpring Damping
• Damping force proportionalto the velocity of the spring
)(tl )( htl +
( ))()(
)()()()()(
tt
tt
h
tlhtlt
01
011 xx
xxF
−−−+−= γ
)(t0x
)(t1x
)( ht +0x
)( ht +1x
• Damps relative movements of mass points• Reduces internal oscillations of the mass-spring model• Requires computation of auxiliary point positions• Problem: Which force direction is correct?
61M Teschner - Deformable Modeling
ETH ZurichForce-Deformation Relationships
( )01
0101
int0 xx
xxxxF
−−−−= Lk
L
0x
1x
( )2
22
01
0101
int0
xx
xxxxF
−−−−= Lk
01
0101int0 xx
xxxxF
−−
−−=
n
L
Lk n odd ! Why ?
• Various computational complexity• Influence on the function, which is integrated
• Definition of forces which work against deformation• No deformation -> no force
62M Teschner - Deformable Modeling
ETH ZurichSpring Properties and Stability
• Behavior of force-deformation relation strongly influences stability.• It’s difficult to simulate stiff structures.• It’s difficult to represent non-oscillating deformable structures.• Human soft tissue
• Large forces should be handled.• No oscillations
springdeformation
force
springdeformation
forceforce
springdeformation
force
springdeformation
softstable
stiffproblematic
oscillatingstable
non-oscillatingdon’t even think
of using it
63M Teschner - Deformable Modeling
ETH ZurichModel Properties and Stability
Movie
• Two different sets of parameters (mass and stiffness)for the same topology
• Higher stiffness difficultto handle
Movie
Teschner
14
64M Teschner - Deformable Modeling
ETH ZurichTopology and Stability –2D
• Design problem
• Stable model topologieswith respect to deformation
not stable
stablebut notgeneral
stablecan be generated automatically bycopying the surface to an inner layerand connecting both – layered model
much more resistant in direction than in direction.
65M Teschner - Deformable Modeling
ETH ZurichTopology and Stability –3D
• Triangulated sphere surface• Edges represented by springs• Stable sphere model represented with two layers of springs• Inner layer is a copy of the surface• Both layers are connected by springs• Stable, but many springs, many forces, computational expensive
66M Teschner - Deformable Modeling
ETH ZurichTopology - Ambiguity Problem
• Unappropriate topology• No force penalty for shearing• Diagonal springs are missing
• Appropriate topology• However, self-collision problem
original equilibrium 1 equilibrium 2
model is attached to these two planes
67M Teschner - Deformable Modeling
ETH ZurichTopology and Stability –2D
• Generating pre-strained models for stability
additionalforces
new stable?equilibrium
relaxed,not stable
Problems:• New equilibrium does not represent given model geometry.• Initiated forces are dependent on surface changes and object transformation.• Initiated forces could be bound to surface normals.
15
68M Teschner - Deformable Modeling
ETH ZurichVolumetric Models
2949 mass points10257 tetras15713 springs
1349 mass points4562 tetras6888 springs
69M Teschner - Deformable Modeling
ETH ZurichPerformance Aspects - Summary
• Performance is difficult to assess!
• Varying time steps
• Model hierarchies, coarse to fine point sampling
• Point and spring damping.
• Force-deformation relationship. Soft and oscillating models are robust.
• Topology. How to connect mass points in an appropriate way?Influence on the stability of the numerical integration
• Topology. How to avoid too many springs?Influence on the performance of the numerical integration
70M Teschner - Deformable Modeling
ETH ZurichOther Forces
• Induction of internal forces by falsifying the initial spring length
consttL =)( )()( tftL =
• Simulation of muscle contraction (or fishes)• L(t) has to be smooth for stability
)( 0tL
relaxedspring
)( 0 htL +no longerrelaxed
72M Teschner - Deformable Modeling
ETH ZurichPenalty Forces
• Penalty forces are additional momentum conserving external forces at mass points.
• Penetration of a mass point into another object can cause a penaltyforce to resolve the collision.
• Volume variation of basic volumetric elements can cause forces topreserve volume.
• Surface changes can cause penalty forces at mass points topreserve certain characteristics of the surface.
• Proper relation of penalty, internal, and other external forceshas to be considered.
• Penalty force functions should be appropriate for numericalintegration.
16
73M Teschner - Deformable Modeling
ETH ZurichPenalty Forces
Collision Surface changes
1
2Penalty
1
2
Penalty
74M Teschner - Deformable Modeling
ETH ZurichDynamic Deformation - Summary
• Discretization of an object into mass points• Definition of the connectivity
(topology, adjacencies of mass points, layers)• Model parameters:
• Consider performance aspects!• Find an appropriate time step
to solve your specific problem !
76M Teschner - Deformable Modeling
ETH Zurich
MotivationModel Components
Mass PointsSpringsForces
Computation of the Dynamic BehaviorExplicit Numerical IntegrationImplicit Numerical IntegrationHigher-Order Numerical Integration
Stability and Performance AspectsPerformanceTime and Space Adaptive SamplingDampingForce-Deformation RelationshipModel Topology
Movies
Outline
17
81M Teschner - Deformable Modeling
ETH ZurichCloth Simulation
FedkiwStanford University
82M Teschner - Deformable Modeling
ETH ZurichHand Simulation
Articulatedbonestructure
Deformablepulp space
Generic skin model
Sibille / Teschner / Latombe
86M Teschner - Deformable Modeling
ETH ZurichA few References
• D. Terzopoulos, J. Platt, A. Barr, K. Fleischer, “Elastically Deformable Models,”SIGGRAPH’87, ACM Computer Graphics, vol. 21, no. 4, pp. 205-214, 1987.
• D. Terzopoulos, K. Fleischer, “Modeling Inelastic Deformation: Viscoelasticity,Plasticity, Fracture,” SIGGRAPH’88, ACM Computer Graphics, vol. 22, no. 4, pp. 269-278, 1988.
• Y. Lee, D. Terzopoulos, K. Waters, “Realistic Modeling for Facial Animation,”SIGGRAPH’95, ACM Computer Graphics, vol. 29, no. 4, pp. 52-62, 1995.
• D. Baraff, A. Witkin, “Large Steps in Cloth Simulation,” SIGGRAPH’98, ACMComputer Graphics, pp. 43-54, 1998.
• M. Desbrun, P. Schroeder, A. Barr, “Interactive Animation of StructuredDeformable Objects,” Graphics Interface ’99, Kingston, Canada, 1999.
• G. Debunne, M. Desbrun, M. Cani, A. Barr, “Dynamic Real-Time Deformationsusing Space and Time Adaptive Sampling,” SIGGRAPHC’01, ACM Computer Graphics, pp. 31-36, 2001.
• H. R. Schwarz, “Numerische Mathematik,” B. G. Teubner Stuttgart, ISBN 3-519-32960-3, 1997.