31
Spring 2006 1 Rigid Body Simulation

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

Embed Size (px)

Citation preview

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

Spring 2006 1

Rigid Body Simulation

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

Spring 2006 2

Contents

Unconstrained Collision ContactResting Contact

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

Spring 2006 3

Review Particle Dynamics

State vector for a single particle:

System of n particles:

Equation of Motion

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

Spring 2006 4

Rigid Body Concepts

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

Spring 2006 5

Rotational Matrix

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

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

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

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

Spring 2006 7

Rotate a Vector

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

Spring 2006 8

= =

Change of R(t)

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

Spring 2006 9

Rigid Body as N particlesCoordinate in body space

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

Spring 2006 10

Center of Mass

World space coordinate

Body space coord.

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

Spring 2006 11

Force and Torque

Total force

Total torque

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

Spring 2006 12

Linear MomentumSingle particle

Rigid body as particles

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

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.

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

Spring 2006 14

Inertia Tensor

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

Spring 2006 15

Inertia Tensor

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

Spring 2006 16

[Moment of Inertia (ref)]

zzzyzx

yzyyyx

xzxyxx

III

III

III

I

Moment of inertia

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

Spring 2006 17

Table: Moment of Inertia

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

Spring 2006 18

Equation of Motion (3x3)

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

Spring 2006 19

Implementation (3x3)

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

Spring 2006 20

Equation of Motion (quaternion)

)(

)(

)()(

)(

)(

)(

)(

)(

)( 21

t

tF

tqt

tv

tL

tP

tq

tx

dt

dtY

dt

d

3×3 matrix

quaternion

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

Spring 2006 21

Implementation (quaternion)

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

Spring 2006 22

Non-Penetration Constraints

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

Spring 2006 23

Collision Detection

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

Spring 2006 24

Colliding Contact

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

Spring 2006 25

Collision

Relative velocityOnly consider vrel < 0

Impulse J:

J

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

Spring 2006 26

Impulse Calculation

[See notes for details]

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

Spring 2006 27

Impulse Calculation

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

000

000

000

011 1I

M

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

Spring 2006 28

Uniform Force Field

Such as gravity

acting on center of mass

No effect on angular momentum

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

Spring 2006 29

Resting Contact: See Notes

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

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

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

Spring 2006 31

xy

5

3

Three walls