Top Banner
Spring 2013 1 Rigid Body Simulation
40

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

Jan 12, 2016

Download

Documents

Beverley Floyd
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Spring 20131 Rigid Body Simulation. Spring 20132 Contents Unconstrained Collision Contact Resting Contact.

Spring 2013 1

Rigid Body Simulation

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

Spring 2013 2

Contents

Unconstrained Collision ContactResting Contact

Page 3: Spring 20131 Rigid Body Simulation. Spring 20132 Contents Unconstrained Collision Contact Resting 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.)

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

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

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

Spring 2013 5

Rotational Matrix

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

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

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

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

Spring 2013 7

Rotate a Vector

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

Spring 2013 8

= =

Change of R(t)

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

Spring 2013 9

Rigid Body as N particlesCoordinate in body space

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

Spring 2013 10

Center of Mass

World space coordinate

Body space coord.

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

Spring 2013 11

Force and Torque

Total force

Total torque

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

Uniform Force Field

No effect on the angular momentum

12Spring 2013

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

Spring 2013 13

Linear MomentumSingle particle

Rigid body as particles

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

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.

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

Spring 2013 15

Inertia Tensor

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

Spring 2013 16

Inertia Tensor

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

Spring 2013 17

[Moment of Inertia (ref)]

zzzyzx

yzyyyx

xzxyxx

III

III

III

I

Moment of inertia

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

Spring 2013 18

Table: Moment of Inertia

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

Inertia Tensor Table (ref)Solid sphere

Hollow sphere

Solid ellipsoid

19Spring 2013

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

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

20Spring 2013

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

Spring 2013 21

Equation of Motion (3x3)

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

Spring 2013 22

Implementation (3x3)

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

Using Quaternion

quaternion

multiplication

Unit quaternionas rotation

Equation of motion

quaternion derivative

23Spring 2013

Later …

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

Spring 2013 24

Equation of Motion (quaternion)

)(

)(

)()(

)(

)(

)(

)(

)(

)( 21

t

tF

tqt

tv

tL

tP

tq

tx

dt

dtY

dt

d

3×3 matrix

quaternion

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

Spring 2013 25

Implementation (quaternion)

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

Computing Qdot

26

Incremental rotation represented in quaternion:

Spring 2013

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

27

dt

dtq

dt

dq

Spring 2013

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

Spring 2013 28

Non-Penetration Constraints

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

Spring 2013 29

Collision Detection (Particle)

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

Spring 2013 30

Colliding Contact

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

Spring 2013 31

Collision

Relative velocityOnly consider vrel < 0

Impulse J:

J

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

Spring 2013 32

Impulse Calculation

[See notes for details]

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

Spring 2013 33

Impulse Calculation

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

000

000

000

011 1I

M

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

Spring 2013 34

Resting Contact

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

Spring 2013 35

Solve the contact forces fi so that for

Relative displacement at contact point i:

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

Spring 2013 36

In contact at t0:

and we want: We need:

Similar logic, we want:

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

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)

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

Details (appendix D)

Spring 2013 38

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

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

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

Spring 2013 40

xy

5

3

Three walls