Rigid Body Dynamics CSE169: Computer Animation Instructor: Steve - - PowerPoint PPT Presentation

rigid body dynamics
SMART_READER_LITE
LIVE PREVIEW

Rigid Body Dynamics CSE169: Computer Animation Instructor: Steve - - PowerPoint PPT Presentation

Rigid Body Dynamics CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2020 Cross Product i j k = a b a a a x y z b b b x y z = a b a b a b a b a b a b a b y


slide-1
SLIDE 1

Rigid Body Dynamics

CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2020

slide-2
SLIDE 2

Cross Product

 

x y y x z x x z y z z y z y x z y x

b a b a b a b a b a b a b b b a a a − − − =  =  b a k j i b a

slide-3
SLIDE 3

Properties of the Cross Product

slide-4
SLIDE 4

Cross Product

 

z y x x z z z x y x z y z y y z x x x y y x z x x z y z z y

b b a b a c b a b b a c b a b a b c b a b a b a b a b a b a  + + − = −  + = + −  =  = − − − =  b a c b a

slide-5
SLIDE 5

Cross Product

                     − − − =            + + − = −  + = + −  =

z y x x y x z y z z y x z y x x z z z x y x z y z y y z x x

b b b a a a a a a c c c b b a b a c b a b b a c b a b a b c

slide-6
SLIDE 6

Cross Product

          − − − =  =                       − − − =           ˆ ˆ

x y x z y z z y x x y x z y z z y x

a a a a a a b b b a a a a a a c c c a b a b a

slide-7
SLIDE 7

Hat Operator

◼ We’ve introduced the ‘hat’ operator which converts a

vector into a skew-symmetric matrix (ො 𝐛𝑈 = −ො 𝐛)

◼ This allows us to turn a cross product of two vectors into

a dot product of a matrix and a vector

◼ This is mainly for algebraic convenience, as the dot

product is associative (although still not commutative) ො 𝐛 ∙ 𝐜 = 𝐛 × 𝐜 ො 𝐛 ∙ 𝐜 ≠ 𝐜 ∙ ො 𝐛 (non commutative) ො 𝐛 ∙ መ 𝐜 ∙ 𝐝 = ො 𝐛 ∙ መ 𝐜 ∙ 𝐝 (associative)

slide-8
SLIDE 8

Derivative of a Rotating Vector

◼ Let’s say that vector r is rotating around the

  • rigin, maintaining a fixed distance

◼ At any instant, it has an angular velocity of ω

r ω r  = dt d r ω 

r

ω

slide-9
SLIDE 9

Derivative of Rotating Matrix

◼ If matrix A is a rigid 3x3 matrix rotating with

angular velocity ω

◼ This implies that the a, b, and c axes must be

rotating around ω

◼ The derivatives of each axis are ωxa, ωxb, and

ωxc, and so the derivative of the entire matrix is:

A ω A ω A  =  = ˆ dt d

slide-10
SLIDE 10

Product Rule

( ) ( )

dt dc ab c dt db a bc dt da dt abc d dt db a b dt da dt ab d + + = + =

◼ The product rule defines the derivative of

products

slide-11
SLIDE 11

Product Rule

◼ It can be extended to vector and matrix products

as well

( ) ( ) ( )

dt d dt d dt d dt d dt d dt d dt d dt d dt d B A B A B A b a b a b a b a b a b a  +  =   +  =   +  = 

slide-12
SLIDE 12

Eigenvalue Equation

slide-13
SLIDE 13

Symmetric Matrix

slide-14
SLIDE 14

Symmetric Matrix Diagonalization

slide-15
SLIDE 15

Dynamics of Particles

slide-16
SLIDE 16

Kinematics of a Particle

  • n

accelerati ity veloc position

2 2

dt d dt d dt d x v a x v x = = =

slide-17
SLIDE 17

Mass, Momentum, and Force

force momentum mass a p f v p m dt d m m = = =

slide-18
SLIDE 18

Moment of Momentum

◼ The moment of momentum is a vector ◼ Also known as angular momentum (the two terms mean

basically the same thing, but are used in slightly different situations)

◼ Angular momentum has parallel properties with linear

momentum

◼ In particular, like the linear momentum, angular

momentum is conserved in a mechanical system

◼ It is typically represented with a capital L, which is

unfortunately inconsistent with our standard of using lowercase for vectors…

p r L  =

slide-19
SLIDE 19

Moment of Momentum

p r L  =

p

1

r

2

r

3

r

p p

◼ L is the same for all three of these particles

slide-20
SLIDE 20

Moment of Momentum

p r L  =

p

1

r

2

r

3

r

p p

◼ L is different for all of these particles

slide-21
SLIDE 21

Moment of Force (Torque)

◼ The moment of force (or torque) about a

point is the rate of change of the moment

  • f momentum about that point

dt dL τ =

slide-22
SLIDE 22

Moment of Force (Torque)

( )

f r τ f r v v τ f r p v τ p r p r L τ p r L  =  +  =  +  =  +  = =  = m dt d dt d dt d

slide-23
SLIDE 23

Rotational Inertia

◼ L=rxp is a general expression for the

moment of momentum of a particle

◼ In a case where we have a particle

rotating around the origin while keeping a fixed distance, we can re-express the moment of momentum in terms of it’s angular velocity ω

slide-24
SLIDE 24

Rotational Inertia

( ) ( ) ( )

r r I ω I L ω r r L ω r r r ω r L v r v r L p r L ˆ ˆ ˆ ˆ  − =  =   − =   − =   =  =  =  = m m m m m m

slide-25
SLIDE 25

Rotational Inertia

          − − − − − − − =           − − −            − − − − =  − =

2 2 2 2 2 2

ˆ ˆ

y x z y z x z y z x y x z x y x z y x y x z y z x y x z y z

r r r r r r r r r r r r r r r r r r m r r r r r r r r r r r r m m I I r r I

slide-26
SLIDE 26

Rotational Inertia

( ) ( ) ( )

ω I L I  =           + − − − + − − − + =

2 2 2 2 2 2 y x z y z x z y z x y x z x y x z y

r r m r mr r mr r mr r r m r mr r mr r mr r r m

slide-27
SLIDE 27

Rotational Inertia

◼ The rotational inertia matrix I is a 3x3 matrix that

is essentially the rotational equivalent of mass

◼ It relates the angular momentum of a system to

its angular velocity by the equation

◼ This is similar to how mass relates linear

momentum to linear velocity, but rotation adds additional complexity

ω I L  =

v p m =

slide-28
SLIDE 28

Systems of Particles

slide-29
SLIDE 29

Systems of Particles

momentum tal to mass

  • f

center

  • f

position particles all

  • f

mass l tota

1

    

= = = =

= i i i cm i i i cm n i i total

m m m m m v p p x x

slide-30
SLIDE 30

Velocity of Center of Mass

cm total cm total cm cm i i i i i i cm i i i cm cm

m m m m m dt d m m m dt d dt d v p p v v x v x x v = = = = = =

     

slide-31
SLIDE 31

Force on a Particle

◼ The change in momentum of the center of mass

is equal to the sum of all of the forces on the individual particles

◼ This means that the resulting change in the total

momentum is independent of the location of the applied force

i i i cm i cm

dt d dt d dt d

   

= = = = f p p p p p

slide-32
SLIDE 32

Systems of Particles

( )

 

 − =  =

i cm i cm i i cm

p x x L p r L

◼ The total moment of momentum around

the center of mass is:

slide-33
SLIDE 33

Torque in a System of Particles

( ) ( )

   

 =  =  = =  =

i i cm i i cm i i cm cm i i cm

dt d dt d dt d f r τ p r τ p r L τ p r L

slide-34
SLIDE 34

Systems of Particles

◼ We can see that a system of particles behaves a lot like

a particle itself

◼ It has a mass, position (center of mass), momentum,

velocity, acceleration, and it responds to forces

◼ We can also define it’s angular momentum and relate a

change in system angular momentum to a force applied to an individual particle

( )

 =

i i cm

f r τ

=

i cm

f f

slide-35
SLIDE 35

Internal Forces

◼ If forces are generated within the particle system

(say from gravity, or springs connecting particles) they must obey Newton’s Third Law (every action has an equal and opposite reaction)

◼ This means that internal forces will balance out

and have no net effect on the total momentum of the system

◼ As those opposite forces act along the same line

  • f action, the torques on the center of mass

cancel out as well

slide-36
SLIDE 36

Dynamics of Rigid Bodies

slide-37
SLIDE 37

Kinematics of a Rigid Body

◼ For the position of the center of mass of the rigid

body:

2 2

dt d dt d dt d

cm cm cm cm cm cm

x v a x v x = = =

slide-38
SLIDE 38

Kinematics of a Rigid Body

slide-39
SLIDE 39

Rigid Bodies

◼ We treat a rigid body as a system of particles, where the

distance between any two particles is fixed

◼ We will assume that internal forces are generated to

hold the relative positions fixed. These internal forces are all balanced out with Newton’s third law, so that they all cancel out and have no effect on the total momentum

  • r angular momentum

◼ The rigid body can actually have an infinite number of

particles, spread out over a finite volume

◼ Instead of mass being concentrated at discrete points,

we will consider the density as being variable over the volume

slide-40
SLIDE 40

Rigid Body Mass

◼ With a system of particles, we defined the total

mass as:

◼ For a rigid body, we will define it as the integral

  • f the density ρ over some volumetric domain Ω

 = d m 

=

=

n i i

m m

1

slide-41
SLIDE 41

Rigid Body Center of Mass

◼ The center of mass is:

 

  = d d

cm

 x x

slide-42
SLIDE 42

Rotational Inertia of a Particle

slide-43
SLIDE 43

Rigid Body Rotational Inertia

( ) ( ) ( )

          =              +  −  −  −  +  −  −  −  + =

        

zz yz xz yz yy xy xz xy xx y x z y z x z y z x y x z x y x z y

I I I I I I I I I d r r d r r d r r d r r d r r d r r d r r d r r d r r I I

2 2 2 2 2 2

        

slide-44
SLIDE 44

Rigid Body Rotational Inertia

The rigid body rotational inertia is a 3x3 symmetric matrix that encodes the distribution of mass around the center of mass

It is calculated by calculating the integrals on the previous slide by integrating over the volume of the rigid body where r indicates the vector from the center of mass to the position of the volume integration element and ρ represents the density at that location

These integrals can be calculated with analytical formulas for simple shapes like spheres, cylinders, and boxes

There also exists an analytical technique for computing them on triangle meshes as well (Mirtich-Eberly algorithm)

slide-45
SLIDE 45

Rotational Inertia Diagonalization

slide-46
SLIDE 46

Diagonalization of Rotational Inertia

slide-47
SLIDE 47

Rotational Inertia of a Box

slide-48
SLIDE 48

Rotational Inertia of a Sphere

slide-49
SLIDE 49

Rotational Inertia

slide-50
SLIDE 50

Derivative of Rotational Inertial

( )

( ) ( )

( )

ω I I ω I ω I I ω ω A I A I ω I A ω I A I ω I A ω I A A I A ω I A I A A I A A I A I ˆ ˆ ˆ ˆ  −  =  +  =    +  =    +  =    +    =         +   =   = dt d dt d dt d dt d dt d dt d dt d dt d

T T T T T T T T T

slide-51
SLIDE 51

Derivative of Angular Momentum

( )

ω I ω I ω τ ω I ω ω I ω I ω τ ω I ω ω I I ω τ ω I ω I L τ ω I L  +   =  +   −   =  +   −  =  +  = =  = ˆ ˆ dt d dt d dt d

slide-52
SLIDE 52

Newton-Euler Equations

ω I ω I ω τ a f  +   = = m

slide-53
SLIDE 53

Applied Forces & Torques

( ) ( )

ω I ω τ I ω f a f r τ f f   −  = =  = =

 

1

1 m

i i cg i cg

slide-54
SLIDE 54

Properties of Rigid Bodies

a f v p a v x m m m = =

ω I ω I ω f r τ ω I L ω ω A I  +   =  =  =

slide-55
SLIDE 55

Rigid Body Simulation

RigidBody { void Update(float time); void ApplyForce(Vector3 &f,Vector3 &pos); private: // constants float Mass; Vector3 RotInertia; // Ix, Iy, & Iz from diagonal inertia // variables Matrix34 Mtx; // contains position & orientation Vector3 Momentum,AngMomentum; // accumulators Vector3 Force,Torque; };

slide-56
SLIDE 56

Rigid Body Simulation

RigidBody::ApplyForce(Vector3 &f,Vector3 &pos) { Force += f; Torque += (pos-Mtx.d) x f }

slide-57
SLIDE 57

Rigid Body Simulation

RigidBody::Update(float time) { // Update position Momentum += Force * time; Mtx.d += (Momentum/Mass) * time; // Mtx.d = position // Update orientation AngMomentum += Torque * time; Matrix33 I = Mtx·I0·MtxT // A·I0·AT Vector3 ω = I-1·L float angle = |ω| * time; // magnitude of ω Vector3 axis = ω; axis.Normalize(); Mtx.RotateUnitAxis(axis,angle); }