13.1 Physically Based Simulation I Hao Li http://cs420.hao-li.com - - PowerPoint PPT Presentation

13 1 physically based simulation i
SMART_READER_LITE
LIVE PREVIEW

13.1 Physically Based Simulation I Hao Li http://cs420.hao-li.com - - PowerPoint PPT Presentation

Fall 2017 CSCI 420 Computer Graphics 13.1 Physically Based Simulation I Hao Li http://cs420.hao-li.com 1 Visual Computing 2 Animation 3 Animation Techniques 4 Physics in Computer Graphics Very common Computer Animation, Modeling


slide-1
SLIDE 1

1

13.1 Physically Based Simulation I

CSCI 420 Computer Graphics

Hao Li

http://cs420.hao-li.com Fall 2017

slide-2
SLIDE 2

2

Visual Computing

slide-3
SLIDE 3

3

Animation

slide-4
SLIDE 4

4

Animation Techniques

slide-5
SLIDE 5

5

Physics in Computer Graphics

  • Very common
  • Computer Animation, Modeling


(computational mechanics)

  • Rendering (computational optics)
slide-6
SLIDE 6

6

Physics in Computer Animation

  • Fluids
  • Smoke
  • Deformable strands (rods)
  • Cloth
  • Solid 3D deformable objects .... and many more!
slide-7
SLIDE 7

7

Physical Simulation

slide-8
SLIDE 8

8

Scientific Goals and Challenges

slide-9
SLIDE 9

9

Offline Physics

  • Special effects (film, commercials)
  • Large models:


millions of particles / tetrahedra / triangles

  • Use computationally expensive rendering


(global illumination)

  • Impressive results
  • Many seconds of computation time per frame
slide-10
SLIDE 10

10

Real-time Physics

  • Interactive systems:


computer games
 virtual medicine (surgical simulation)

  • Must be fast (30 fps, preferably 60 fps for games)


Only a small fraction of CPU time devoted to physics!


  • Has to be stable, regardless of user input

slide-11
SLIDE 11

11

Examples

slide-12
SLIDE 12

12

Fluids

Enright, Marschner,
 Fedkiw, 
 SIGGRAPH 2002

slide-13
SLIDE 13

13

Fluids and Rigid Bodies

slide-14
SLIDE 14

14

Fluids with Deformable Solid Coupling

[Robinson-Mosher, 
 Shinar, 
 Gretarsson, 
 Su, Fedkiw, 
 SIGGRAPH 2008]

slide-15
SLIDE 15

15

Deformations

[Barbic and James,
 SIGGRAPH 2005]

slide-16
SLIDE 16

16

Cloth

Source:
 ACM SIGGRAPH

slide-17
SLIDE 17

17

Cloth (Robustness)

[Bridson, Fedkiw, Anderson, ACM SIGGRAPH 2002

slide-18
SLIDE 18

18

Multibody Dynamics + 
 Self-collision Detection

[Barbic and James, SIGGRAPH 2010]

slide-19
SLIDE 19

19

Surgical Simulation

[James and Pai, SIGGRAPH 2002]

slide-20
SLIDE 20

20

Multibody Dynamics

slide-21
SLIDE 21

21

Physics in Games

[Parker and James,
 Symposium on Computer Animation 2009]

slide-22
SLIDE 22

22

Sound Simulation (Acoustics)

[James, Barbic, Pai, SIGGRAPH 2006]

slide-23
SLIDE 23

23

Techniques

slide-24
SLIDE 24

24

Particle System

slide-25
SLIDE 25

25

Particle System

slide-26
SLIDE 26

26

Mass-Spring Systems

slide-27
SLIDE 27

27

Applications

slide-28
SLIDE 28

28

Rigid Body Simulation

slide-29
SLIDE 29

29

Challenges

slide-30
SLIDE 30

30

Applications

slide-31
SLIDE 31

31

Grid-Based Methods

slide-32
SLIDE 32

32

Example: Fluid Surface

slide-33
SLIDE 33

33

FEM Simulation

slide-34
SLIDE 34

34

Case Study: Mass-spring Systems

  • Mass particles


connected by
 elastic springs

  • One dimensional:


rope, chain

  • Two dimensional:


cloth, shells

  • Three dimensional:


soft bodies

Source:Matthias Mueller, SIGGRAPH

slide-35
SLIDE 35

35

Newton’s Laws

  • Newton’s 2nd law:

a m F ! ! =

  • Newton’s 3rd law: If object A exerts a force F on
  • bject B, then object B is at the same time

exerting force -F on A.

  • Gives acceleration, given the force and mass

F !

F ! −

slide-36
SLIDE 36

36

Single spring

  • Obeys the Hook’s law:

F = k (x - x0)

  • x0 = rest length
  • k = spring elasticity


(stiffness)

  • For x<x0, spring


wants to extend

  • For x>x0, spring 


wants to contract

slide-37
SLIDE 37

37

Hook’s law in 3D

  • Assume A and B two mass points connected with

a spring.

  • Let L be the vector pointing from B to A
  • Let R be the spring rest length
  • Then, the elastic force exerted on A is:

| | ) | (| L L R L k F

Hook

! ! ! ! − − =

slide-38
SLIDE 38

38

Damping

  • Springs are not completely elastic
  • They absorb some of the energy and tend to decrease the

velocity of the mass points attached to them

  • Damping force depends on the velocity:
  • kd = damping coefficient
  • kd different than kHook !!

v k F

d

! ! − =

slide-39
SLIDE 39

39

A network of springs

  • Every mass point connected to


some other points by springs


  • Springs exert forces 

  • n mass points

– Hook’s force – Damping force


  • Other forces

– External force field

  • Gravity
  • Electrical or magnetic force field

– Collision force

slide-40
SLIDE 40

40

Network organization is critical

  • For stability, must organize the network of

springs in some clever way

Basic network Stable network Network out 


  • f control
slide-41
SLIDE 41

41

Time Integration

Physics equation: x’ = f(x,t) x=x(t) is particle 
 trajectory

Source:Andy Witkin, SIGGRAPH

slide-42
SLIDE 42

42

Euler Integration Simple,
 but inaccurate. Unstable with
 large timesteps.

Source:Andy Witkin, SIGGRAPH

x(t + Δt) = x(t) + Δt f(x(t))

slide-43
SLIDE 43

43

“Blow-up”

Source:Andy Witkin, SIGGRAPH

Gain energy

Inaccuracies with explicit Euler

slide-44
SLIDE 44

44

Midpoint Method

Improves stability

  • 1. Compute Euler step


Δx = Δt f(x, t)


  • 2. Evaluate f at the midpoint


fmid = f((x+Δx)/2, (t+Δt)/2)

  • 3. Take a step using the midpoint

value
 x(t+ Δt) = x(t) + Δt fmid

Source:Andy Witkin, SIGGRAPH

slide-45
SLIDE 45

45

Many more methods

  • Runge-Kutta (4th order and higher orders)
  • Implicit methods

– sometimes unconditionally stable – very popular (e.g., cloth simulations) – a lot of damping with large timesteps

  • Symplectic methods

– exactly preserve energy, angular momentum and/or

  • ther physical quantities

– Symplectic Euler

slide-46
SLIDE 46

46

Cloth Simulation

  • Cloth Forces
  • Many methods are 


a more advanced version 


  • f a mass-spring system
  • Derivatives of Forces

– necessary for stability

  • Stretch
  • Shear
  • Bend

[Baraff and Witkin,
 SIGGRAPH 1998]

slide-47
SLIDE 47

47

Challenges

  • Complex Formulas
  • Large Matrices
  • Stability
  • Collapsing triangles
  • Self-collision detection

[Govindaraju et al. 2005]

slide-48
SLIDE 48

48

Deformable model is 
 self-colliding iff there exist non-neighboring
 intersecting triangles. 


Self-collisions: definition

slide-49
SLIDE 49

49

Bounding volume hierarchies

[Hubbard 1995] [van den Bergen 1997] [Gottschalk et al. 1996] [Bridson et al. 2002] [Teschner et al. 2002] [Govindaraju et al. 2005]

AABBs
 Level 1

AABBs
 Level 3

slide-50
SLIDE 50

50

Bounding volume hierarchy

root root

slide-51
SLIDE 51

51

Bounding volume hierarchy

v w v w

slide-52
SLIDE 52

52

Real-time cloth simulation

Model Triangles FPS % Forces + Stiffness Matrix % Solver Curtain 2400 25 67 33

Source:
 Andy Pierce

slide-53
SLIDE 53

http://cs420.hao-li.com

Thanks!

53