+ All Categories
Home > Documents > Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment [email protected].

Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment [email protected].

Date post: 26-Mar-2015
Category:
Upload: haley-burns
View: 225 times
Download: 0 times
Share this document with a friend
Popular Tags:
27
Bending, Breaking and Bending, Breaking and Squishing Stuff Squishing Stuff Marq Singer Marq Singer Red Storm Entertainment Red Storm Entertainment [email protected] [email protected]
Transcript
Page 1: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Bending, Breaking and Bending, Breaking and Squishing StuffSquishing Stuff

Marq SingerMarq SingerRed Storm EntertainmentRed Storm Entertainment

[email protected]@redstorm.com

Page 2: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Synopsis

This is the last lecture of the day, so I’ll try to be nice

Stuff that’s cool, but not essential Soft body dynamics Breaking and bending stuff Generating sounds

Page 3: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Squishing Stuff

Soft Body Dynamics

Page 4: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

The Basics

Use constraints to limit behavior For our purposes, we will treat each

discreet entity as one particle in a system

Particles can be doors on hinges, bones in a skeleton, points on a piece of cloth, etc.

Page 5: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Spring Constraints

Seems like a reasonable choice for soft body dynamics (cloth)

In practice, not very useful Unstable, quickly explodes

Page 6: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Stiff Constraints

A special spring case does work Ball and Stick/Tinkertoy Particles stay a fixed distance apart Basically an infinitely stiff spring Simple Not as prone to explode

Page 7: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Cloth Simulation

Use stiff springs Solving constraints by relaxation Solve with a linear system

Page 8: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Cloth Simulation0P

1P

5P

1,0C 2,1C5,0C

Page 9: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Cloth Simulation

Forces on our cloth

m

tFtta

tatvttv

tvtpttp

ii

iii

iii

)()(

)()(

)()(

Page 10: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Cloth Simulation

Relaxation is simple Infinitely rigid springs are stable

1. Predetermine Ci distance between particles

2. Apply forces (once per timestep)3. Calculate for two particles4. If move each particle half the distance5. If n = 2, you’re done!

Page 11: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Relaxation Methods

0P 1P

1,0C

2)()(,

2)()(:0 1100

ptPttP

ptPttPp

Page 12: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Relaxation Methods

0P 1P

1,0C

0P 1P 2)()(,

2)()(:0 1100

ptPttP

ptPttPp

Page 13: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Relaxation Methods

0P 1P

1,0C

0P 1P 2)()(,

2)()(:0 1100

ptPttP

ptPttPp

Page 14: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Relaxation Methods

1,0C

0P 1P 2)()(,

2)()(:0 1100

ptPttP

ptPttPp

0P 1P

Page 15: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Relaxation Methods

1,0C

0P 1P 2)()(,

2)()(:0 1100

ptPttP

ptPttPp

0P 1P

Page 16: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Relaxation Methods

1,0C

0P 1P 2)()(,

2)()(:0 1100

ptPttP

ptPttPp

0P 1P

Page 17: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Cloth Simulation

When n > 2, each particle’s movement influenced by multiple particles

Satisfying one constraint can invalidate another

Multiple iterations stabilize system converging to approximate constraints

Forces applied (once) before iterations Fixed timestep (critical)

Page 18: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

More Cloth Simulation

Use less rigid constraints Vary the constraints in each

direction (i.e. horizontal stronger than vertical)

Warp and weft constraints

Page 19: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Still More Cloth Simulation Sheer Springs

Page 20: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Still More Cloth Simulation Flex Springs

Page 21: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Using a Linear System

Can sum up forces and constraints Represent as system of linear

equations Solve using matrix methods

Page 22: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Basic Stuff

Systems of linear equations

Where:A = matrix of coefficientsx = column vector of variablesb = column vector of solutions

bAx

Page 23: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Basic Stuff

Populating matricies is a bit tricky, see [Boxerman] for a good example

Isolating the ith equation:

i

n

j

jij bxa 1

Page 24: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Jacobi Iteration

Solve for xi (assume other entries in x unchanged):

ii

ij

kjiji

ki a

xabx

)1(

)(

(Which is basically what we did a few slides back)

Page 25: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Jacobi Iteration

In matrix form:

bDxULDx kk 1)1(1)( )(

D, -L, -U are subparts of AD = diagonal-L = strictly lower triangular-U = strictly upper triangular

Page 26: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Jacobi IterationDefinition (diagonal, strictly lower, strictly upper):

A = D - L - U

DLLL

UDLL

UUDL

UUUD

Page 27: Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment marqs@redstorm.com.

Lots More Math(not covered here) I highly recommend [Shewchuk 1994] Gauss-Seidel Successive Over Relaxation (SOR) Steepest Descent Conjugate Gradient Newton’s Method (in some cases) Hessian Newton variants (Discreet, Quasi,

Truncated)


Recommended