SC1 P HYSICALLY B ASED M ODELING Overview Overview One Lousy - - PowerPoint PPT Presentation

sc1
SMART_READER_LITE
LIVE PREVIEW

SC1 P HYSICALLY B ASED M ODELING Overview Overview One Lousy - - PowerPoint PPT Presentation

S IGGRAPH 2001 C OURSE N OTES SC1 P HYSICALLY B ASED M ODELING Overview Overview One Lousy Particle Particle Systems Forces: gravity, springs Implementation and Interaction Simple collisions S IGGRAPH 2001 C OURSE N OTES


slide-1
SLIDE 1

SC1 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-2
SLIDE 2

Overview Overview

  • One Lousy Particle
  • Particle Systems
  • Forces: gravity, springs …
  • Implementation and Interaction
  • Simple collisions

SC2 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-3
SLIDE 3

A Newtonian Particle A Newtonian Particle

  • Differential equation: f = ma
  • Forces can depend on:

– Position, Velocity, Time

( , , ) t m = f x x x ɺ ɺɺ

SC3 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-4
SLIDE 4

Second Order Equations Second Order Equations

Not in our standard form because it has 2nd derivatives Add a new variable, v, to get a pair of coupled 1st order equations.

( , , ) t m = f x x x ɺ ɺɺ m =   =  x v v f ɺ ɺ

SC4 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-5
SLIDE 5

Phase Space Phase Space

Concatenate x and v to make a 6-vector: Position in Phase Space. Velocity in Phase Space: another 6-vector. A vanilla 1st-order differential equation.

      x v       x v ɺ ɺ m     =         x v v f ɺ ɺ

SC5 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-6
SLIDE 6

Particle Structure Particle Structure

x v f

m

Position Velocity Force Accumulator mass Position in Phase Space

SC6 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-7
SLIDE 7

Solver Interface Solver Interface

x v f

m

Get/Set State Deriv Eval

6

Dim(state)

v

f m

x v

SC7 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-8
SLIDE 8

Particle Systems Particle Systems

x v f

m

x v f

m

x v f

m

x v f

m

x v f

m

particles n time

x v f

m

SC8 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-9
SLIDE 9

Solver Interface Solver Interface

6n x1 v1 x2 v2 xn vn v1 f1 m1 v2 f2 m2 vn fn mn

particles n time

Deriv Eval Deriv Eval Get/Set State Get/Set State Dim(State) Dim(State)

Particle System Diffeq Solver

SC9 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-10
SLIDE 10

Deriv Eval Loop Deriv Eval Loop

  • Clear forces

– Loop over particles, zero force accumulators.

  • Calculate forces

– Sum all forces into accumulators.

  • Gather

– Loop over particles, copying v and f/m into destination array.

SC10 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-11
SLIDE 11

Forces Forces

  • Constant

gravity

  • Position/time dependent

force fields

  • Velocity-Dependent

drag

  • n-ary

springs

SC11 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-12
SLIDE 12

Force Structures Force Structures

  • Unlike particles, forces are

heterogeneous.

  • Force Objects:

– black boxes – point to the particles they influence – add in their own forces (type dependent)

  • Global force calculation:

– loop, invoking force objects

SC12 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-13
SLIDE 13

Particle Systems, with forces Particle Systems, with forces

x v f

m

x v f

m …

x v f

m

particles n time forces nforces

… F

F

F F F

A list of force

  • bjects to invoke

SC13 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-14
SLIDE 14

Gravity Gravity

x v f

m

G apply_fun p sys

p->f += p->m * F->G p->f += p->m * F->G

F Force Law:

Particle system

grav

m = f G

SC14 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-15
SLIDE 15

Viscous Drag Viscous Drag

x v f

m

k apply_fun p sys

p->f -= F->k * p->v p->f -= F->k * p->v

F Force Law:

Particle system

drag drag

k = − f v

SC15 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-16
SLIDE 16

Damped Spring Damped Spring

x v f

m

F

x v f

m

ks p2 p1 kd apply_fun sys Particle system

Force Law:

( )

1 2 1 s d

k r k     ∆ ⋅∆ ∆ = − ∆ − +     ∆ ∆       = − v x x f x x x f f

SC16 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-17
SLIDE 17

Deriv Eval Loop Deriv Eval Loop

… F

F

F F F

Clear Force Accumulators Invoke apply_force functions

x v f

m

x v f

m …

x v f

m

x v f

m

x v f

m …

x v f

m

Return [v, f/m,…] to solver.

1 2 3

SC17 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-18
SLIDE 18

Solver Interface Solver Interface

Get/Set State

System

Dim(state)

Solver

Deriv Eval

You are Here

SC18 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-19
SLIDE 19

Bouncing off the Walls Bouncing off the Walls

  • Later: rigid body

collision and contact.

  • For now, just simple

point-plane collisions.

  • Add-ons for a particle

simulator.

SC19 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-20
SLIDE 20

Normal and Tangential Components Normal and Tangential Components

VN = (N⋅V)N VT = V - VN

VT VN V N

SC20 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-21
SLIDE 21

Collision Detection Collision Detection

N X V P

N⋅V < 0

( )

X - P ⋅N < ε

  • Within ε of the wall.
  • Heading in.
  • Within ε of the wall.
  • Heading in.

SC21 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-22
SLIDE 22

Collision Response Collision Response

VN VT

  • krVN

V V′ = VT - krVN V′ VT

Before After

SC22 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-23
SLIDE 23

Conditions for Contact Conditions for Contact

N P V F X

  • On the wall
  • Moving along the wall
  • Pushing against the wall
  • On the wall
  • Moving along the wall
  • Pushing against the wall

N⋅V < ε

( )

X - P ⋅N < ε

SC23 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-24
SLIDE 24

Contact Force Contact Force

The wall pushes back, cancelling the normal component of F. (An example of a constraint force.) F F′ N

F′ = FT

  • FN

SC24 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-25
SLIDE 25

Basic 2-D Interaction Basic 2-D Interaction

X X X

Operations: – Create – Attach – Drag – Nail

Cursor Cursor Mouse Spring Mouse Spring Nail Nail

SC25 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING

slide-26
SLIDE 26

Try this at home! Try this at home!

The notes give you everything you need to build a basic interactive mass/spring simulator—try it.

SC26 SIGGRAPH 2001 COURSE NOTES PHYSICALLY BASED MODELING