Spring 20131 Rigid Body Simulation. Spring 20132 Contents Unconstrained Collision Contact Resting Contact.

Post on 12-Jan-2016

216 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

Transcript

Spring 2013 1

Rigid Body Simulation

Spring 2013 2

Contents

Unconstrained Collision ContactResting Contact

Spring 2013 3

Review Particle Dynamics

State vector for a single particle:

System of n particles:

Equation of Motion

Solved by ODE Solvers (Euler, RK4, etc.)

Rigid Body Concepts

• Body space– Origin: center of mass

• p0: an arbitrary point on the rigid body, in body space.– Its world space location p(t)

• Spatial variables of the rigid body: 3-by-3 rotation matrix R(t) and x(t)

4Spring 2013

Spring 2013 5

Rotational Matrix

Direction of the x, y, and z axes of the rigid body in world space at time t.

Spring 2013 6

Velocity

Linear velocity Angular veclocity Spin: (t)

How are R(t) and (t) related?Columns of dR(t)/dt: describe the velocity with which the x, y, and z axes are being transformed

Spring 2013 7

Rotate a Vector

Spring 2013 8

= =

Change of R(t)

Spring 2013 9

Rigid Body as N particlesCoordinate in body space

Spring 2013 10

Center of Mass

World space coordinate

Body space coord.

Spring 2013 11

Force and Torque

Total force

Total torque

Uniform Force Field

No effect on the angular momentum

12Spring 2013

Spring 2013 13

Linear MomentumSingle particle

Rigid body as particles

Spring 2013 14

Angular Momentum

I(t) — inertia tensor, a 33 matrix, describes how the mass in a body is distributed relative to the center of mass

I(t) — inertia tensor, a 33 matrix, describes how the mass in a body is distributed relative to the center of mass

I(t) depends on the orientation of the body, but not the translation.

I(t) depends on the orientation of the body, but not the translation.

Spring 2013 15

Inertia Tensor

Spring 2013 16

Inertia Tensor

Spring 2013 17

[Moment of Inertia (ref)]

zzzyzx

yzyyyx

xzxyxx

III

III

III

I

Moment of inertia

Spring 2013 18

Table: Moment of Inertia

Inertia Tensor Table (ref)Solid sphere

Hollow sphere

Solid ellipsoid

19Spring 2013

The Football in Flight (ref)Gravity does not exert torqueAngular momentum stays the same

20Spring 2013

Spring 2013 21

Equation of Motion (3x3)

Spring 2013 22

Implementation (3x3)

Using Quaternion

quaternion

multiplication

Unit quaternionas rotation

Equation of motion

quaternion derivative

23Spring 2013

Later …

Spring 2013 24

Equation of Motion (quaternion)

)(

)(

)()(

)(

)(

)(

)(

)(

)( 21

t

tF

tqt

tv

tL

tP

tq

tx

dt

dtY

dt

d

3×3 matrix

quaternion

Spring 2013 25

Implementation (quaternion)

Computing Qdot

26

Incremental rotation represented in quaternion:

Spring 2013

27

dt

dtq

dt

dq

Spring 2013

Spring 2013 28

Non-Penetration Constraints

Spring 2013 29

Collision Detection (Particle)

Spring 2013 30

Colliding Contact

Spring 2013 31

Collision

Relative velocityOnly consider vrel < 0

Impulse J:

J

Spring 2013 32

Impulse Calculation

[See notes for details]

Spring 2013 33

Impulse Calculation

For things don’t move (wall, floor):

000

000

000

011 1I

M

Spring 2013 34

Resting Contact

Spring 2013 35

Solve the contact forces fi so that for

Relative displacement at contact point i:

Spring 2013 36

In contact at t0:

and we want: We need:

Similar logic, we want:

Solving Contact Forces

Spring 2013 37

First constraint on contact forces fi:

Second constraint on fi (repulsive):

Third constraint (no force when contact breaks)

Quadric Programming(or Linear Complementarity Program to be exact)

Details (appendix D)

Spring 2013 38

Spring 2013 39

Exercise

Implement a rigid block falling on a floor under gravity

x

y

5

3

thickness: 2M = 6

Moments of inertiaIxx = (32+22)M/12Iyy = (52+22)M/12Izz = (32+52)M/12

342

292

132

1

234

229

213

00

00

00

00

00

00

bodybody II

Inertia tensor

Spring 2013 40

xy

5

3

Three walls

top related