Docsity

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

Partial preview of the text

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

Cloth Simulation

Cloth Simulation

 Cloth simulation has been an important topic in

computer animation since the early 1980’s

 It has been extensively researched, and has

reached a point where it is basically a solved

problem

 Today, we will look at a very basic method of

cloth simulation. It is relatively easy to

implement and can achieve good results. It will

also serve as an introduction to some more

advanced cloth simulation topics.

Cloth Simulation

  • • •

Particle

Spring-damper

Particle

a f

m

v

r

=

i

f f

force

momentum

m mass

accelerati on

velocity

position

f

p

a

v

r

p = m v

Physics Simulation

General Physics Simulation:

  1. Compute forces
  2. Integrate motion
  • Repeat

Cloth Simulation

  1. Compute Forces

For each particle: Apply gravity

For each spring-damper: Compute & apply forces

For each triangle: Compute & apply aerodynamic forces

  1. Integrate Motion

For each particle: Apply forward Euler integration

Spring-Dampers

1

r

2

r

2

v

1

v

 The basic spring-damper connects

two particles and has three constants

defining its behavior

 Spring constant: k

s

 Damping factor: k

d

 Rest length: l

0

Spring-Damper

 A simple spring-damper class might look like:

class SpringDamper {

float SpringConstant,DampingFactor;

float RestLength;

Particle P1,P2;

public:

void ComputeForce();

};

Spring-Dampers

 To compute the forces in 3D:

 Turn 3D distances & velocities into 1D

 Compute spring force in 1D

 Turn 1D force back into 3D force

Spring-Damper Force

 We start by computing the unit length

vector e from r

1

to r

2

 We can compute the distance l

between the two points in the process

1

r

2

r

l

l

2 1

e

e

e

e r r

e

l

Spring-Dampers

 Now, we can find the 1D force and

map it back into 3D

f e

sd

= f

1

e

2 1

1

0 1 2

f f

f e

sd

sd s d

f

f k l l k v v

2 1

f = − f

Aerodynamic Force

 In the last lecture, we defined a simple

aerodynamic drag force on an object as:

_: density of the air (or water…)

c

d

: coefficient of drag for the object

a: cross sectional area of the object

e : unit vector in the opposite direction of the

velocity

f v c a e

aero d

2

= ρ

v

v

e = −

Aerodynamic Force

 In order to compute the aerodynamic

forces, we need surfaces to apply it to

 We will add some triangles to our

cloth definition, where each triangle

connects three particles

1

r

2

r

3

r

Aerodynamic Force

 In order to compute our force:

we will need find the velocity,

normal, and area of the triangle

(we can assume that _ and c

d

are constants) 1

r

2

r

3

r f v c a n

aero d

2

= − ρ