Upload
poppy
View
49
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Simulation and Animation. Rigid Body Simulation. The next few lectures …. Comming up …. Dynamic simulation . Movement of point masses, rigid bodies, systems of point masses etc. with respect to Forces Body charcteristics (mass, shape) - PowerPoint PPT Presentation
Citation preview
computer graphics & visualization
Simulation and Animation
Rigid Body Simulation
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
The next few lectures…
• Point Dynamics • Rigid Bodies • Soft Bodies
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Comming up…• P
oint Dynamics• no extend• only position
• Rigid Bodies
• extended
• positioned & oriented
• „a set of points“
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Dynamic simulation • Movement of point masses, rigid bodies,
systems of point masses etc. with respect to– Forces – Body charcteristics (mass, shape)– Derivation of accelerations from properties and
physical laws
• Dynamic of point masses• Dynamic of rigid bodies
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Dynamic simulation• Newtons Axioms
– Without external forces, a bodymoves uniformly (Inertia)
– An external force F applied to amass m results in an acceleration a:F = ma
– Actio = reactio
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Now…• P
oint Dynamics• no extend• no orientation
• Rigid Bodies
• Extended
• Oriented
• „a set of points“
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Point dynamics• Dynamic simulation of particles
– Position r, mass m, velocity v,acceleration a, but no extend
– Forces F act on particles
F,a,v,r are 3D vectors!!!
2
F Fv(t dt) v(t) dt v(t dt) v(t) dtm m
1 F 1r(t dt) r(t) v(t)dt dt r(t) v(t) v t dt dt2 m 2
)()( tt rv )()( tt va )(tamF
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Point dynamics• Dynamic simulation of particles
– Multiple forces may acton particles
• Forces are added by vector addition
– F is usually a function of time– Mass might change as well
• Change of momentum (Impuls) with change of time
dtmvdF )(
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Point dynamics• Particles have no internal structure
• 3 DOF = degrees of freedom (position only)• Direct kinematic: from a v r• Indirect kinematic:
from r and boundary conditions v a
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Point dynamics• Relation between force F
and acceleration a
• Direct dynamics
mtt )()( Fa Point mass
0
0
0
0
)()()()(
)()()()(
)()(
rvrvr
vavav
Fa
tdtttt
tdtttt
mtt
t
t
t
t
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Point dynamics• Important Forces
– Gravity
– Hooke's Law
– Friction
F mg
F ku
F v
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Point dynamics • Linear momentum (Impuls)
– Force F act on center of mass
• Force
• Conservation of momentum
• Example: elastic push
vp m
pF
0p
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Point dynamics• Angular momentum (Drall)
• Torque (Drehmoment)
• Conservation of angular momentum
)( rrprL m r
p
dT L (r p) r Fdt
0 FrL
Moment of inertia: I = mr2
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Point dynamics• Angular velocity of a point (rate at which the point is rotating):
magnitude of change
• Notation:
0
||0000
rωrωrωrωr
0r||0r
0r
00
0mit **
xy
xz
yz
aaaa
aaababa
ω
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Point dynamics• Analog for rotation matrix R - it changes under angular velocity
• Aggregate movement of a body point– (r0/r(t): position in local/world space coordinate system)
RωωωωR *)()()(
zz
zy
zx
yz
yy
yx
xz
xy
xx
RRR
tRRR
tRRR
t
)()()()(
)()()(
)()()()(
0*
0*
ttttttt
tttt
CMCM
CMCMCM
CM
rrωvrrrRωv
rRωvr
CMtt rrRr 0)()(
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Point dynamics• Relation between angular momentum
and angular velocity
• Inertia tensor I (Trägheitstensor)
L r p r (mr) mr r mr (ω r)Iω
2 2
2 2
2 2
m(r x ) m yx m zxI m xy m(r y ) m zy
m xz m yz m(r z )
Symmetrictensor
Example:Skater
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Point dynamicsSummary
Translation RotationPosition r Angle velocity v Angular velocity Momentum p Angular momentum LForce F Torque T
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Next…• P
oint Dynamics• no extend• no orientation
• Rigid Bodies
• Extended
• Oriented
• „a set of points“
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation• Idea
– Combination of many small particles to a rigid body– Bodies that do not deform – they are stiff– They do not penetrate– They bounce back if they collide– Rigid convex polyhedra of constant density– 6 DOF instead of 3n DOF (for n particles)
• Distinguish between – Movement of center of mass (CM)– Rotation around (CM)
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation• Mass M
in continuous case
imM
small, discrete mass points
3)( dVMV r Volume integral over
entire body
Mass density (= specific weight = Mass/Volume)
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation• CM (center of mass)
in continuous case
Mtm
t ii)(
)(CM
rr
3
VCM
(r, t) r(t)dVr (t)
M
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation• Dynamic simulation of rigid bodies
– Motion consist of translational and angular component
– Velocity v(t) is rate of change of position r(t) over time
• v(t) = r´(t) • v(t) is linear velocity at center of mass
– Bodies also have a spin• About an axis (vector) through the center of mass• Magnitude of the vector defines how fast the body is
spinning
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation• Translation and Rotation:
• Rotation R: – 3*3 Matrix– Redundancies– only 3 DOF
0)()()( rRrr ttt CM
CMlocal/fixedcoordinate system
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation
Translation Rotation
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation• Momentum
• Movement of CM
• Force Fext is sum of all external forces
CM CMp (t) Mr (t)
CM CM CM extp (t) Mr (t) Mv (t) F (t)
)()( iext,ext tt FF
CM CMv (t) r (t)
R
Fext,i
Fext
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation• Angular momentum
• Inertia tensor I
ωrωr
rrprL
I
m
m
iii
iiiii
))((
)(
2 2i i i i i i i i i
2 2i i i i i i i i i
2 2i i i i i i i i i
m (r x ) m y x m z xI m x y m (r y ) m z y
m x z m z x m (r z )
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation• Angular momentum
• Inertia tensor I in continuous case
ωL I
2 3jk jk j kV
I (r) (r r r )dV
Kronecker-symbol
x,y,z coordinates
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
• Translation vs. RotationMass Inertia Moment (Trägheitsmoment)
m Velocity Angular Velocity
v =dr/dt = d/dtMomentum Angular Momentum
p = mv L = I = r x pForce Torque
F = dp/dt T = r x F = dL/dt Kinetc Energy Kinetic Energy
E = ½ mv2 E = ½ I2
Rigid body simulation
2
VI (r)r dr
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation• Properties of the Inertia tensor
– Diagonal elements are moments of inertia with respect to coordinate axes
– It is symmetric and real• Has three principal axis (eigenvectors)
• Eigenvectors are orthogonal: directions of inertia (Hauptträgheitsachsen)
• Eigenvalues are real: moments of inertia (Hauptträgheitsmomente)
i i i
i i i i i i
Ir I r
(I diag(I , I , I ))r 0 I diag(I , I , I ) 0 i 1,2,3
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation• Inertia tensor
– In this (directions of inertia) coordinate system, I can be diagonalized by RIRT, where R is a rotation matrix:
• Inertia moment (scalar) for rotation around axis n (normalized)
3
2
1
000000
II
II
Tik i kn
I n I n I n n
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation• Torque of single „body element“
• Total torque
• Important: starting point of force
• Equations of motion for rotation(Euler equations for fixed coordinate system)
iii ttt FrrT ))()(()( CM
ii ttt FrrT ))()(()( CM
TL
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation• State vector of a rigid body
• Constants:– Inertia tensor IKS
– Mass M
)()(
)()(
)(CM
CM
tt
tt
t
LpRr
X
Position
Orientation (rotation matrix)
Impuls
Angular momentum
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation• Derived variables
CMCM
TKS
1 1 TKS
1
p (t)v (t)M
I(t) R(t)I R(t)
I (t) R(t)I R(t)
ω(t) I(t) L(t)
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation• Equations of motion
)()(
)()()(
)()(
)()(
)(ext
*CM
CM
CM
tt
ttt
tt
tt
dtdt
TFRω
v
LpRr
X
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation• System of ordinary partial differential equations• Initial boundary problem• Structure
• In general, numeric solution (Integration)– Explicit solve: Euler, Runge-Kutta– Implicit solver
00 )())(,()(
xxxfx
tttt
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Numerical Integration• Initial value problem:
• Simple approach: Euler
• Derivation: Taylor expansion
• First order scheme• Higher accuracy with smaller step size
),()( tt xfx
),()()( ttttt xfxx
)()()()( 2tOttttt xxx
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Numerical Integration• Problems of Euler-Scheme
• Inaccurate
• Unstable
• Example:kt
f (x, t) kx
x(t) e
Divergenz für t > 2/k
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Numerical Integration• Midpoint method:
1. Euler-Step
2. Evaluation of f at midpoint
3. Step with value at midpoint
• Second order scheme
),( tt xfx
2
,2mid
ttxxff
mid)( fx ttt
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Numerical Integration• Fourth order Runge-Kutta
• Adaptive step size control
54321
34
23
12
1
6336)(
,2
,2
2,
2
),(
tOtt
ttt
ttt
ttt
tt
kkkkxx
kxfk
kxfk
kxfk
xfk
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Numerical Integration• So far: Explicit techniques• Stable integration by means of implicit integration
schemes• Implicit Euler-Step
• „rewind“ the explicit Euler-Step• Taylor-expansion around t + t instead of t• Solving the non-linear system of equations for
x(t + t)
ttttftttt ),()()( xxx
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation• Demo
computer graphics & visualization
Simulation and Animation – SS07Jens Krüger – Computer Graphics and Visualization Group
Rigid body simulation• Summary
Torque TForces Fext
Angular moment LImpuls pCM
Angular velocity Velocity vCM
Orientation R Position rCM
RotationTranslation
Inertia tensor Mass M