# Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment

## Presentation on theme: "Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment"— Presentation transcript:

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

Synopsis This is the last lecture of the day, so Ill try to be nice Stuff thats cool, but not essential Soft body dynamics Breaking and bending stuff Generating sounds

Squishing Stuff Soft Body Dynamics

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.

Spring Constraints Seems like a reasonable choice for soft body dynamics (cloth) In practice, not very useful Unstable, quickly explodes

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

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

Cloth Simulation

Forces on our cloth

Cloth Simulation Relaxation is simple Infinitely rigid springs are stable 1. Predetermine C i distance between particles 2. Apply forces (once per timestep) 3. Calculate for two particles 4. If move each particle half the distance 5. If n = 2, youre done!

Relaxation Methods

Cloth Simulation When n > 2, each particles 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)

More Cloth Simulation Use less rigid constraints Vary the constraints in each direction (i.e. horizontal stronger than vertical) Warp and weft constraints

Still More Cloth Simulation Sheer Springs

Still More Cloth Simulation Flex Springs

Using a Linear System Can sum up forces and constraints Represent as system of linear equations Solve using matrix methods

Basic Stuff Systems of linear equations Where: A = matrix of coefficients x = column vector of variables b = column vector of solutions

Basic Stuff Populating matricies is a bit tricky, see [Boxerman] for a good example Isolating the ith equation :

Jacobi Iteration Solve for x i (assume other entries in x unchanged): (Which is basically what we did a few slides back)

Jacobi Iteration In matrix form: D, -L, -U are subparts of A D = diagonal -L = strictly lower triangular -U = strictly upper triangular

Jacobi Iteration Definition (diagonal, strictly lower, strictly upper): A = D - L - U

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

Download ppt "Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment"

Similar presentations