Spring 20061 Rigid Body Simulation. Spring 20062 Contents Unconstrained Collision Contact Resting...

Preview:

Citation preview

Spring 2006 1

Rigid Body Simulation

Spring 2006 2

Contents

Unconstrained Collision ContactResting Contact

Spring 2006 3

Review Particle Dynamics

State vector for a single particle:

System of n particles:

Equation of Motion

Spring 2006 4

Rigid Body Concepts

Spring 2006 5

Rotational Matrix

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

Spring 2006 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 2006 7

Rotate a Vector

Spring 2006 8

= =

Change of R(t)

Spring 2006 9

Rigid Body as N particlesCoordinate in body space

Spring 2006 10

Center of Mass

World space coordinate

Body space coord.

Spring 2006 11

Force and Torque

Total force

Total torque

Spring 2006 12

Linear MomentumSingle particle

Rigid body as particles

Spring 2006 13

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 2006 14

Inertia Tensor

Spring 2006 15

Inertia Tensor

Spring 2006 16

[Moment of Inertia (ref)]

zzzyzx

yzyyyx

xzxyxx

III

III

III

I

Moment of inertia

Spring 2006 17

Table: Moment of Inertia

Spring 2006 18

Equation of Motion (3x3)

Spring 2006 19

Implementation (3x3)

Spring 2006 20

Equation of Motion (quaternion)

)(

)(

)()(

)(

)(

)(

)(

)(

)( 21

t

tF

tqt

tv

tL

tP

tq

tx

dt

dtY

dt

d

3×3 matrix

quaternion

Spring 2006 21

Implementation (quaternion)

Spring 2006 22

Non-Penetration Constraints

Spring 2006 23

Collision Detection

Spring 2006 24

Colliding Contact

Spring 2006 25

Collision

Relative velocityOnly consider vrel < 0

Impulse J:

J

Spring 2006 26

Impulse Calculation

[See notes for details]

Spring 2006 27

Impulse Calculation

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

000

000

000

011 1I

M

Spring 2006 28

Uniform Force Field

Such as gravity

acting on center of mass

No effect on angular momentum

Spring 2006 29

Resting Contact: See Notes

Spring 2006 30

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 2006 31

xy

5

3

Three walls