Download presentation

Presentation is loading. Please wait.

Published byFrank Been Modified over 2 years ago

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

2
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

3
The Basics Constraint – something that keeps an entity in the system from moving freely 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.

4
Box Constraints P 100 0

5
Box Constraints (cont) Confine P to extents of the box Recover from violations in position (last valid, rebound, wrap around) Simple, yet the basis for the rest of this

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

7
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

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

9
Cloth Simulation

10
Forces on our cloth

11
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!

12
Relaxation Methods

13

14

15

16

17

18
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 before iterations Fixed timestep (critical)

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

20
Still More Cloth Simulation Sheer Springs

21
Still More Cloth Simulation Flex Springs

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

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

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

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

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

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

28
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)

29
Dynamic Destruction Assigning material properties to rigid bodies Object break, bend, spindle and mutilate uniquely Similar principle to constrained dynamics

30
Tools For Destruction 3D tessellation Creating constraints Material properties Offline processing

31
3D Tessellation Uses entire volume of object Tessellate into tetrahedrons (3D version of creating a triangle mesh)

32
Creating Constraints Spring connection between (non-rendered) vertices Particles displaced within spring limitations return to constrained position Particles that move further break the constraint Split in center and form two new virtual vertices

33
Dynamic Destruction

34

35

36

37

38

39

40
Material Properties Analogous to tensile and compressive strength Additional properties add a more realistic effect Strain and strain rate tensors Elastic and plastic strain components Penalty methods on forces based on particle depth

41
Retessellating Breaking a solid object can result in creation of new surface polygon Pieces have to be retesselated and retextured New chunks are also new rigid bodies in the system

42
Dynamic Destruction Demos: Destructo-Bunny Crash2 Pseudo Interactive, E3 Demo, May 2004 Crash2

43
Dynamic Destruction Reckless destruction of tofu

44
Squishing Stuff Dynamic fracture is expensive Deformation can be cheaper Only allow squishing Modal analysis to create component pieces Nastiest processing can be done offline

45
Modal Analysis What the heck is it? Looks more complicated than it really is Comes from material science/fatigue analysis Separates the vibrational characteristics of a material into discreet shapes (modes) Modes can be combined additively to create complex behavior

46
Modal Analysis d = vector of positions K = function of elastic forces (e.g. spring-mass) C = takes velocities, returns dampening forces f = vector of external forces on the system (collisions, user input, etc.). M = takes accelerations ( ), returns required forces

47
Modal Analysis Assuming small displacements, linearize to:

48
Modal Analysis – Warning: Crunchy Math Ahead! A bunch of steps are in the end notes Complicated Involves some unfamiliar manipulations Getting there is hard, but the end result is fairly easy to grasp

49
Modal Analysis End result : Z i is the ith row of our final matrix c1 and c2 are complex constants and is the complex frequency: The absolute value of the imaginary part of is the frequency(rads/s) of the mode. The real part is the rate of decay.

50
Modal Analysis All modes for an object can be processed offline and stored in a lookup table When a forces is applied, look up the modes and their comparative strength Modes can simply be added to obtain the final displacement of a particle in the system

51
Dynamic Sound Generation [Some magic happens here] No…really!

52
Dynamic Sound Generation Interesting side effect of deformation Modes look a lot like wavelets (because they are) Combined modes are basically a complex wave The same modes can be expressed as a sound wave and sent to the audio renderer (in real time) This is very cool!

53
Dynamic Sound Examples: Metal Bowl Wood Bowl Falling Bunny Bodies

54
Summary Everything comes down to particles Theres way too many refinements to soft body dynamics to list here Initial math for modal analysis is complex, but application is simple Lots of offline processing

55
References Boxerman, Eddy and Ascher, Uri, Decomposing Cloth, Eurographics/ACM SIGGRAPH Symposium on Computer Animation (2004) Eberly, David, Game Physics, Morgan Kaufmann, Jakobsen, Thomas, Advanced Character Physics, Gamasutra Game Physics Resource Guide Mathews, John H. and Fink, Kurtis K., Numerical Methods Using Matlab, 4th Edition, Prentice-Hall 2004 J. F. O'Brien, C. Shen, and C. M. Gatchalian, Synthesizing Sounds from Rigid-Body Simulations, ACM SIGGRAPH Symp. Computer Animation, July 21-22, Pentland, A., and Williams, J. Good vibrations: Modal dynamics for graphics and animation. In SIGGRAPH 1989

56
References Shewchuk, Jonathan Richard, An Introduction to the Conjugate Gradient Method Without the Agonizing Pain, August Tohru Miyazaki, Toyohisa Kaneko, and Shigeru Kuriyama Virtual Destruction of a 3D Object with a Stick, WSCG Conference proceedings Witken, Andrew, David Baraff, Michael Kass, SIGGRAPH Course Notes, Physically Based Modeling, SIGGRAPH Yu, David, The Physics That Brought Cel Damage to Life: A Case Study, GDC 2002

57
End Notes Modal Analysis in Detail Most of this comes from [OBrien 02] and [Pentland 89] Recall: Using Raleigh Dampening, C can be expressed as a linear combination of the mass and stiffness matrices given some constants 1 and 2

58
End Notes Modal Analysis in Detail Substituting C : Given that M is symmetric and positive definite, there is a Cholesky factorization such that define a new variable pre-multiply above equation by L -1, and express M in terms of y

59
End Notes Modal Analysis in Detail Decompose matrix such that V = orthogonal matrix, columns are eigenvectors of = the diagonal matrix of eigenvalues. Define variable z in terms of y where Pre-multiply last equation by V T :

60
End Notes Modal Analysis in Detail After some mathematical gymnastics: where What weve done here is taken our linearized equation (with Raleigh dampening), and converted to a diagonal matrix of decoupled oscillators. The i 'th row of the above equation is the scalar, second-order differential equation

61
End Notes Modal Analysis in Detail i is the ith entry in matrix The analytical solution to our differential equation is: And that brings us back to the final equation in the slides:

Similar presentations

© 2016 SlidePlayer.com Inc.

All rights reserved.

Ads by Google