1cs533d-winter-2005 notes read “physically based modelling” siggraph course notes by witkin and...

21
1 cs533d-winter-2005 Notes Notes Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative way to derive the equations of motion for rigid bodies

Post on 19-Dec-2015

217 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

1cs533d-winter-2005

NotesNotes

Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections)• An alternative way to derive the equations of

motion for rigid bodies

Page 2: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

2cs533d-winter-2005

Von Mises yield criterionVon Mises yield criterion

If the stress has been diagonalized:

More generally:

This is the same thing as the Frobenius norm of the deviatoric part of stress• i.e. after subtracting off volume-changing part:

1

2σ 1 −σ 2( )

2+ σ 2 −σ 3( )

2+ σ 3 −σ 1( )

2≤ σ Y

32 σ

F

2− 1

3 Tr σ( )2

≤ σ Y

32 σ − 1

3 Tr σ( )IF

≤ σ Y

Page 3: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

3cs533d-winter-2005

Linear elasticity shortcutLinear elasticity shortcut

For linear (and isotropic) elasticity, apart from the volume-changing part which we cancel off, stress is just a scalar multiple of strain• (ignoring damping)

So can evaluate von Mises with elastic strain tensor too (and an appropriately scaled yield strain)

Page 4: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

4cs533d-winter-2005

Perfect plastic flowPerfect plastic flow

Once yield condition says so, need to start changing plastic strain

The magnitude of the change of plastic strain should be such that we stay on the yield surface• I.e. maintain f()=0

(where f()≤0 is, say, the von Mises condition) The direction that plastic strain changes isn’t as

straightforward “Associative” plasticity:

˙ ε p = γ∂f

∂σ

Page 5: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

5cs533d-winter-2005

AlgorithmAlgorithm

After a time step, check von Mises criterion: is ?

If so, need to update plastic strain:

• with chosen so that f(new)=0(easy for linear elasticity)

f (σ ) = 32 dev σ( )

F−σ Y > 0

εpnew = ε p + γ

∂f

∂σ

= ε p + γ 32

dev(σ )

dev(σ )F

Page 6: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

6cs533d-winter-2005

Multi-Dimensional Multi-Dimensional FractureFracture

Smooth stress to avoid artifacts (average with neighbouring elements)

Look at largest eigenvalue of stress in each element

If larger than threshhold, introduce crack perpendicular to eigenvector

Big question: what to do with the mesh?• Simplest: just separate along closest mesh face• Or split elements up: O’Brien and Hodgins• Or model crack path with embedded geometry:

Molino et al.

Page 7: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

7cs533d-winter-2005

Rigid BodiesRigid Bodies

Page 8: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

8cs533d-winter-2005

Rigid BodiesRigid Bodies

Most volumes in the real world are very stiff---not visibly deformable

Rather than stiff and expensive deformable mechanics, mathematically abstract this into perfectly rigid bodies• Constrain motion to rigid body modes• Avoid having to model internal “constraint” forces which

keep bodies rigid More efficient, but rigid abstraction can cause

problems… Still, best approach especially for real-time

simulations of such objects - e.g. games• Even large objects which deform may be best

decomposed into rigid parts

Page 9: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

9cs533d-winter-2005

Object Space vs. World Object Space vs. World SpaceSpace

As before, we have rest/reference/object space configuration (label points with variable p)

And current/real/world space configuration (position is x(p))

First note:• If it ever gets confusing, replace continuous matter

with a finite set of mass points (object space positions p1, p2, … and world space positions x1, x2, …)

Rigidity means that x(p,t)=R(t)p+X(t)• R is a rotation matrix (orthogonal and det(R)=1)• X is a translation vector

Page 10: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

10cs533d-winter-2005

KinematicsKinematics

Differentiate map in time:

Invert map for p:

Thus:

1st term: rotation, 2nd term: translation• Let’s simplify the rotation

v = ˙ R p + V

p = RT (x − X)

v = ˙ R RT (x − X) + V

Page 11: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

11cs533d-winter-2005

Skew-SymmetrySkew-Symmetry

Differentiate RRT= w.r.t. time:

Skew-symmetric! Thus can write as:

Call this matrix (built from a vector )

˙ R RT + R ˙ R T = 0 ⇒ ˙ R RT = − ˙ R RT( )

T

˙ R RT =

0 −ω2 ω1

ω2 0 −ω0

−ω1 ω0 0

⎜ ⎜ ⎜

⎟ ⎟ ⎟

˙ R RT = ω∗ ⇒ ˙ R = ω∗R

Page 12: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

12cs533d-winter-2005

The cross-product matrixThe cross-product matrix

Note that:

So we have:

is the angular velocity of the object Magnitude gives speed of rotation, direction gives axis of

rotation

∗x =

0 −ω2 ω1

ω2 0 −ω0

−ω1 ω0 0

⎜ ⎜ ⎜

⎟ ⎟ ⎟

x0

x1

x2

⎜ ⎜ ⎜

⎟ ⎟ ⎟=

ω1x2 −ω2x1

ω2x0 −ω0x2

ω0x1 −ω1x0

⎜ ⎜ ⎜

⎟ ⎟ ⎟= ω × x

v = ω × x − X( ) + V

Page 13: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

13cs533d-winter-2005

Velocity ModesVelocity Modes

Think of linear space of all possible velocities, and choose a set of basis vectors for the subspace of allowed motions (rigid body motions)• Think back to modal dynamics…

In this case, velocity is a linear combination of 3 translations and 3 rotations, with coefficients V and

Write this as v=Su, or

v(x) = S(x)u

= δ X * − x*( )

Vω ⎛ ⎝ ⎜ ⎞

⎠ ⎟ = V − (x − X) ×ωK[ ]

Page 14: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

14cs533d-winter-2005

Virtual WorkVirtual Work

The internal “constraint” forces are going to keep v in the span of S, so v=Su for some coefficients u

But assume (and this is the key assumption) that they don’t mess with these allowed modes

That is, they are orthogonal:• STFint=0• They do no “virtual work”

For example, internal forces won’t cause an object to out of the blue start translating, or rotating…• Can derive from, for example, the assumption that down

at some level forces between particles are in the direction between particles

Page 15: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

15cs533d-winter-2005

Constrained DynamicsConstrained Dynamics

We have F=Ma, i.e. Now plug in form for constrained velocity

And eliminate the internal forces:€

M ˙ v = Fint + Fext

MS˙ u + M ˙ S u = Fint + Fext

ST MS˙ u + ST M ˙ S u = ST Fint

= 01 2 3 + ST Fext

ST MS( ) ˙ u + ST M ˙ S ( )u = ST Fext

Page 16: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

16cs533d-winter-2005

Working it outWorking it out

What is the matrix multiplying du/dt?

Using total mass M (not the matrix!) and centre of mass XCM this simplifies to:

ST MS = δX *T − x i

*T ⎛ ⎝ ⎜

⎞ ⎠ ⎟M i δ X * − x i

*( )

i

= mi

δ X * − x i*

X *T − x i*T X * − x i

*( )

TX * − x i

*( )

⎝ ⎜ ⎜

⎠ ⎟ ⎟

i

Mδ MX * − MXCM*

MX *T − MXCM*T mi X − x i( )

*TX − x i( )

*

i

∑ ⎛

⎜ ⎜

⎟ ⎟

Page 17: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

17cs533d-winter-2005

Can we do better?Can we do better?

We have some freedom in defining S Don’t have to rotate about the origin: can rotate

around the centre of mass instead• This will let us zero out the off-diagonal blocks, make it

simpler to invert the 6x6 matrix That is, X=XCM so that STMS becomes

We call I(t) the “inertia tensor”

Mδ 00 mi X − x i( )

*TX − x i( )

*

i

∑ ⎛

⎝ ⎜ ⎜

⎠ ⎟ ⎟= Mδ 0

0 I(t) ⎛ ⎝ ⎜ ⎞

⎠ ⎟

Page 18: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

18cs533d-winter-2005

Change of SChange of S

There was also the dS/dt term Note that identity matrix is constant: disappears We get

Note simplification from mivi summing to MV Left with dI(t)/dt in lower right corner

ST M ˙ S = miδ

X *T − x i*T

⎛ ⎝ ⎜

⎞ ⎠ ⎟ 0 V * − v i

*( )

i

= mi

0 V * − v i*

0 X − x i( )*T

V − v i( )*

⎝ ⎜

⎠ ⎟

i

=0 00 mii

∑ X − x i( )*T

V − v i( )*

⎝ ⎜

⎠ ⎟

Page 19: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

19cs533d-winter-2005

What about the external What about the external forces?forces?

What is STFext?

We call F the net force, and the net torque

ST Fext = δX *T − x i

*T ⎛ ⎝ ⎜

⎞ ⎠ ⎟ f i

i

=f ii

∑x i − X( )

i∑ × f i

⎝ ⎜ ⎜

⎠ ⎟ ⎟

= Fτ ⎛ ⎝ ⎜ ⎞

⎠ ⎟

Page 20: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

20cs533d-winter-2005

Equations of MotionEquations of Motion

Plugging it all in (and assuming centre of mass is at the origin in object space)

Call L=I(t) the angular momentum• The component of momentum in the rotational mode

Also add in

M ˙ V = Fd

dtI(t)ω( ) = τ

˙ X = V˙ R = ω*R

Page 21: 1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative

21cs533d-winter-2005

To DoTo Do

Figure out I(t) efficiently Numerically integrate the ODE’s

• Turns out R is not a good representation for the current rotation

Look at the net force and torque of some external forces• Gravity• Collisions