Docsity

Cloth Simulation Two - Computer Animation - Lecture Slides, Slides of Computer Graphics and Animation

Partial preview of the text

Download Cloth Simulation Two - Computer Animation - Lecture Slides and more Slides Computer Graphics and Animation in PDF only on Docsity!

System Stability

Conservation of Momentum

 As real springs apply equal and opposite forces

to two points, they obey conservation of

momentum

 Our simple spring-damper implementation

should actually guarantee conservation of

momentum, due to the way we explicitly apply

the equal and opposite forces

 (This assumes that everything says within

reasonable floating point ranges and we don’t

suffer from excessive round-off)

Conservation of Energy

 If we formulate the equations correctly and take

small enough time steps, the system will

hopefully conserve energy approximately

 In practice, we might see a gradual increase or

decrease in system energy over time

 A gradual decrease of energy implies that the

system damps out and might eventually come to

rest. A gradual increase, however, it not so

nice…

Conservation of Energy  There are particle schemes that conserve energy, and other schemes that preserve momentum (and/or angular momentum)  It’s possible to conserve all three, but it becomes significantly more complicated  This is important in engineering applications, but less so in entertainment applications  Also, as we usually want things to come to rest, we explicitly put in some energy loss through controlled damping  Still, we want to make sure that our integration scheme is stable enough not to gain energy

Integration

 There are many methods of numerical

integration. Some examples are:

 Explicit Euler  Implicit Euler  Midpoint (Leapfrog)  Crank-Nicolson  Runge-Kutta  Adams-Bashforth, Adams-Moulton  etc…

Two-Level Integration Methods

 Explicit Euler:  Implicit Euler  Midpoint (Leapfrog):  Crank-Nicolson:

f t t

n n n n

1 ϕ ϕ ϕ

f t t

n n n n

1 1 1

f t t

n n n n

1 / 2 1 / 2 1

( f t f t ) t

n n n n n n

1 1

Runge-Kutta Methods

 The Runge-Kutta integration methods compute the value at step n+1 by computing several partial steps between n and n+1 and then constructing a polynomial to get the final value at n+  Second order Runge-Kutta:

1 / 2 1 / 2 1 1 / 2

n n n n n n n n

t f t

f t

t

Cloth Stability

 To make our cloth stable, we should choose a better integration scheme (such as adaptive time-step fourth order Runge-Kutta)  It’s actually not quite as bad as it sounds  But, in the mean time, some other options include:  Oversampling: For one 1/60 time step, update the cloth several times at smaller time steps (say 10 times at 1/600), then draw once  Tuning numbers: High spring constants and damping factors will increase the instability. Lowering these will help, but will also make the cloth look more like rubber…

Continuum Mechanics

 Real cloth simulation rarely uses springs  Instead, forces are generated based on the the deformation of a triangular element  This way, one can properly account for internal forces within the piece of cloth based on the theory of continuum mechanics  The basic process is still very similar. Instead of looping through springs computing forces, one loops through the triangles and computes the forces  Continuum models account for various properties such as elastic deformation, plastic deformation, bending forces, anisotropy, and more

Collision Detection & Response

 Cloth colliding with rigid objects is tricky  Cloth colliding with itself is even trickier  There have been several published papers on robust cloth collision detection and response methods