rick parent - cis682 rigid body dynamics simulate basic physics of an object subject to forces...

23
Rick Parent - CIS68 Rigid Body Dynamics simulate basic physics of an object subject to forces eyframing can be tedious - especially to get ‘reali Animator gives up control Animator gets ‘realistic’ motion automatically. Simulate physics by - programming equations of motions - setting initial conditions

Upload: james-horn

Post on 18-Jan-2018

219 views

Category:

Documents


0 download

DESCRIPTION

Rick Parent - CIS682 Object under Forces Forces Gravity Wind Springs Collision avoidance Soft constraints Calculate acceleration due to forces Calculate update to object velocity & position

TRANSCRIPT

Page 1: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Rigid Body Dynamicssimulate basic physics of an

object subject to forcesKeyframing can be tedious - especially to get ‘realism’

Animator gives up control

Animator gets ‘realistic’ motion automatically.

Simulate physics by - programming equations of motions- setting initial conditions

Page 2: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Siimulation Update Cycle

Object propertiesPosition, orientationLinear and angular velocityLinear and angular momentummass

Calculate forces

Calculate accelerationsUsing mass, momenta

Update object properties

Page 3: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Object under Forces

ForcesGravityWindSpringsCollision avoidanceSoft constraints

Calculate acceleration due to forces

Calculate update to object velocity & position

Page 4: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Object under Linear Force

Use a(t) to update current state of point mass: x(t), v(t)

Given: force, f(t), gives rise to acceleration, a(t), or )( itx

21

11

1

1

)(21)()()(

2))()(()()(

)()()()()()(

ttxttxtxtx

ttxtxtxtx

ttxtxtxttxtxtx

iiii

iiii

iii

iii

Page 5: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Equations of Motion

Linear force

Linear momentum

Resistance to linear force: mass

Conserved in a closed system

Angular force: torque

Angular momentum

Resistance to angular force: inertia tensor.

Page 6: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Rotational Movement

Represent orientation with rotation matrix: R(t)

Represent angular velocity with vector: (t)- direction is axis of rotation - magnitude is speed of rotation

Angular velocity insensitive to distance from center or rotation

Page 7: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Rotational Movement

b

r (t)

(t)

)sin()()()( trttr

)()()( trttr

a b r(t)(t) - angular velocity

r(t) - position of a relative to b

b - point on axis of rotation

- angle r(t) makes with axis of rotation

Page 8: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Rotational Movement

R(t) R1(t) R2(t) R3(t)

)()()()()()()( 321 tRttRttRttR

R(t) - rotation matrix representing the orientation of a rigid body

Change in rotation matrix can be computed by taking cross product of w(t) with each column

Columns are vectors to positions a unit length on principle axis

Page 9: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Rotational Movement )()()()()()()( 321 tRttRttRttR

AAAA

AAAA

AAA

z

y

x

xy

xz

yz

xyyx

zxxz

yzzy

*

00

0

Define the following for notational convenience to define cross product as a matrix operation:

Page 10: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Velocity of a Point

)()()( txqtRtq

q - original position of point in rigid bodyx(t) - position of rigid bodyv(t) - velocity of rigid bodyq(t) – time-dependent position of point in rigid body

)()()( * tRttR )()()( txqtRtq

)()()()( tvqtRttq

Page 11: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Center of Mass

Integration of differential mass times position in object

M mi

x(t) miqi(t)M

Approximate by summing over representational particles in object

Object’s “position” is the position of its center of mass

Mass is the object’s resistance to a change in velocity

Page 12: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Force and Torque

)()( tt i F

F

Force on center of mass results in linear acceleration

Force off-center of mass is torque and creates angular acceleration - what is angular mass?

)()(

/

tftF

mFamaF

i

)())()(()( tftxtqt ii

Page 13: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

But first…Linear Momentum

mvp Mass times velocity

Sum over all particles of object

Use total mass for linear momentum

Change in (linear) momentum is equal to force

)()()( tFtvMtP

)()( tvmtP ii

)()( tMvtP

Page 14: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Angular Momentum - measure of rotating mass weighted by its distance from the axis

of rotation

))))()(()(()(( txtqtmqtR i

Relative position of particle Relative velocity of particlemass

Factor out mass

))()(())()((()( tvtqmtxtqtL i

))))()(()((( qtRtqtRmi

Page 15: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Angular Momentum

L(t) (mi(R(t)q ((t) R(t)q)))

)()(

)()()(

ttL

ttItL

Define Inertia Tensor, I(t), that captures distribution of mass

Similar to the linear case, the change in Angular Momentum is equal to torque

Page 16: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Inertia Tensor - object’s resistance to a change in rotational velocity

Iobject Ixx Ixy Ixz

Ixy Iyy Iyz

Ixz Iyz Izz

I(t) R(t)IobjectR(t)T

Ixx (q)(qy2 qz

2)dxdydz

Page 17: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Inertia Tensor

Ixx (q)(qy2 qz

2)dxdydz

Ixx mi(y i2 zi

2)Iyy mi(x i

2 zi2)

Izz mi(x i2 y i

2)

Ixy mix iy iIxz mix iziIyz miy izi

Page 18: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Inertia Tensor for a Cuboid

1

12

M (b2 + c2)

M (a2 + c2)

M (a2 + b2)

0 0

0

0

0

0

Page 19: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Finally, the Equations - State vector

S (t) =

x (t)

R (t)

P (t)

L (t)

Update with velocityUpdate with angular velocityUpdate with force

Update with torque

v(t) P(t) / M

I(t) R(t)IobjectR(t)T

)()()( * tRttR

)()(

)()()(

ttL

tFtvMtP

(t) I(t) 1L(t)

Given: S(t), M, Iobject

Page 20: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Update State Vector

ddt

S(t) ddt

x(t)R(t)P(t)L(t)

v(t)(t)* R(t)

F(t) (t)

Page 21: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Update Orientation - options

R(t) += (t) * R(t) and re-orthonormalize

Extract axis-angle from (t) and rotate columns of R(t)

Use quaternions to rotate quaternion version of R(t)

Page 22: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

QuickTime™ and aVideo decompressor

are needed to see this picture.

Page 23: Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’

Rick Parent - CIS682

Now, what about collisions?