Download lecture14

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Hamiltonian mechanics wikipedia , lookup

Relativistic quantum mechanics wikipedia , lookup

Bra–ket notation wikipedia , lookup

Analytical mechanics wikipedia , lookup

Lagrangian mechanics wikipedia , lookup

Derivations of the Lorentz transformations wikipedia , lookup

Specific impulse wikipedia , lookup

Old quantum theory wikipedia , lookup

Force wikipedia , lookup

Fictitious force wikipedia , lookup

Classical mechanics wikipedia , lookup

Virtual work wikipedia , lookup

Hunting oscillation wikipedia , lookup

Velocity-addition formula wikipedia , lookup

Newton's theorem of revolving orbits wikipedia , lookup

Symmetry in quantum mechanics wikipedia , lookup

Precession wikipedia , lookup

Seismometer wikipedia , lookup

Tensor operator wikipedia , lookup

Moment of inertia wikipedia , lookup

Jerk (physics) wikipedia , lookup

Center of mass wikipedia , lookup

Routhian mechanics wikipedia , lookup

Laplace–Runge–Lenz vector wikipedia , lookup

Inertia wikipedia , lookup

Momentum wikipedia , lookup

Relativistic mechanics wikipedia , lookup

Theoretical and experimental justification for the Schrödinger equation wikipedia , lookup

Accretion disk wikipedia , lookup

Photon polarization wikipedia , lookup

Torque wikipedia , lookup

Centripetal force wikipedia , lookup

Angular momentum wikipedia , lookup

Newton's laws of motion wikipedia , lookup

Equations of motion wikipedia , lookup

Classical central-force problem wikipedia , lookup

Angular momentum operator wikipedia , lookup

Kinematics wikipedia , lookup

Relativistic angular momentum wikipedia , lookup

Rigid body dynamics wikipedia , lookup

Transcript
Advanced Computer Graphics
Rigid Body Simulation
Spring 2002
Professor Brogan
Upcoming Assignments
• Who wants a midterm instead of an
assignment?
• Final will be take home
• Cloth/water/parallel particle sim presentations
– Volunteers?
– Papers selected by Thursday
Physical Simulation
• References
– Text book (4.3 and Appendix B)
– Physics for Game Developers (Bourg)
– Chris Hecker Game Developer articles
• http://www.d6.com/users/checker/dynamics.htm
Equations of Motion
• The physics-based equations that
define how objects move
– Gravity
– Turbulence
– Contact forces with objects
– Friction
– Joint constraints
Equations of Motion
Current State
Equations of
Motion
Position and velocity
Integrate
Forces
Integrate
Velocities
Accelerations
Integrate
Equations of Motion
r (t )   v(t )dt
• Linear motions:
v(t )   a (t )dt
• Example:
– Constant
acceleration of
5 m/s2
v(t )   a dt   5dt  5t  C
v(0)  5(0)  C
v0  C
v(t )  5t  v0
5
r (t )   v(t )dt   5t  v0 dt  t 2  v0t  r0
2
Linear Momentum
• Mass times velocity = linear momentum, p

p  mv
• Newton’s Second Law
  dp d (mv )



F  p

 mv  ma
dt
dt
Ceasing to identify vectors…
Rigid Bodies
• Imagine a rigid body as a set of point masses
• Total momentum, pT, is sum of momentums of
i i
all points: p T 
mv

i
• Center of Mass (CM) is a
single point. Vector to CM
CM
r

is linear combination of
vectors to all points in rigid
body weighted by their masses,
divided by total mass of body
i i
m
 r
i
M
Total Momentum
• Rewrite total momentum in terms of CM
i i
d (m r ) d ( Mr
p  m v  

dt
dt
i
i
T
CM
i i
)
• Total linear momentum equals total mass
times the velocity of the center of mass
(For continuous rigid bodies, all summations turn
into integrals over the body, but CM still exists)
• We can treat all bodies as single point mass
and velocity
Total Force
• Total force is derivative of the total momemtum
– Again, CM simplifies total force equation of a rigid
body
F  p  Mv
T
T
CM
 Ma
CM
– We can represent all forces acting on a body as if
their vector sum were acting on a point at the center
of mass with the mass of the entire body
Intermediate Results
• Divide a force by M to find acceleration of the
center of mass
• Integrate acceleration over time to get the
velocity and position of body
• Note we’ve ignored where the forces are
applied to the body
• In linear momentum, we don’t keep track of
the angular terms and all forces are applied
to the CM.
Ordinary Differential
Equations
• A DifEq is an equation with
– Derivatives of the dependent variable
– Dependent variable
– Independent variable
• Ex:
dv
v
a

dt
m
• v’s derivative is a function of its current value
• Ordinary refers to ordinary derivatives
– As opposed to partial derivatives
Integrating ODEs
• Analytically solving ODEs is
complicated
• Numerically integrating ODEs is much
easier (in general)
– Euler’s Method
– Runge-Kutta
Euler’s Method
• Based on calculus definition of first
derivative = slope
Euler’s Method
• Use derivative at time n to integrate h
units forward
dyn
yn 1  yn  h
dx
Euler Errors
• Depending on ‘time step’ h, errors will
accumulate
SIGGRAPH Course Notes
Accumulating Errors
SIGGRAPH Course Notes
Recap
Angular Effects
• Let’s remain in 2-D plane for now
• In addition to kinematic variables
– x, y positions
• Add another
kinematic variable
– W angle
– CCW rotation of object
axes relative to world
axes
Angular Velocity
• w is the angular velocity
d W dw

 w  a
2
dt
dt
2
• a is the angular acceleration
Computing Velocities
• How do we combine linear and angular
quantities?
• Consider velocity of a point, B, of a rigid body
rotating about its CM
v  wr
B
OB
• r_perp is perpendicular to r vector from O to B
• Velocity is w-scaled perpendicular vector from
origin to point on body
More Details
•
•
•
•
Point B travels W radians
Point B travels C units
Radius of circle is r
C= Wr
– By definition of radians,
where circumference = 2pr
• B’s speed (magnitude of velocity vector)
– Differentiate C= Wr w.r.t. time
d (Wr ) dW

r  wr
dt
dt
More Details
• The direction of velocity is tangent to
circle == perpendicular to radius
• Therefore, linear
velocity is angular
velocity multiplied
by tangent vector
Chasles’ Theorem
• Any movement is decomposed into:
– Movement of a single point on body
– Rotation of body about that point
• Linear and Angular Components
v  v  wr
B
O
OB
Angular Momentum
• The angular momentum of point B
about point A (we always measure
angular terms about some point)
• It’s a measure of how much of point B’s
linear momentum is rotating around A
AB
L
 r
AB
p
B
Angular Momentum
• Check: If linear
momentum, pB, is
perpendicular to
r_perp, then dot
product of two will
cause angular
momentum will be
zero
Torque
• Derivative of Angular Momentum
– Remember force was derivative of linear
momentum
AB B )
AB
dL
d (r p


dt
dt
AB
AB
B
 r  ma  r  F B
– This measures how much of a force
applied at point B is used to rotate about
point A, the torque
Total Angular Momentum
• Total angular momentum about point A is
denoted LAT
Ai i
AT
L   r p
i
  r m i v i
Ai
i
• But computation can be expensive to sample
all points
• Sampling of a surface would require surface
integration
Moment of Inertia
• Remember v  wr
B
AT
L
  r p i
Ai
i
  r m i v i
Ai
OB
i
– An alternate way of representing the
velocity of a point in terms of angular
velocity
• If A is like the origin
L   r m wr
i
i is like B, then substitute
Ai
AT
i
Ai
 w  m r r
i
Ai
Ai
i
 w  m (r )
i
i
 wI
A
Ai 2
Moment of Inertia, IA
• The sum of squared distances from
point A to each other point in the body,
and each squared distance is scaled by
the mass of each point
Ai 2
i
A
 m (r

) I
i
• This term characterizes how hard it is to
rotate something
– Ipencil_center will be much less than Ipencil_tip
Total Torque
• Differentiate total
 AT
angular momentum
to get total torque
• This relates total torque and the body’s
angular acceleration through the scalar
moment of inertia
dLAT

 d ( I Aw )
dt
 I Aw  I Aa
Planar Dynamics
•
•
•
•
•
•
•
•
Calculate COM and MOI of rigid body
Set initial position and linear/angular velocities
Figure out all forces and their points of application
Sum all forces and divide by mass to find COM’s linear
acceleration
For each force, compute perp-dot-product from COM to point of
force application and add value into total torque of COM
Divide total torque by the MOI at the COM to find angular
acceleration
Numerically integrate linear/angular accelerations to update the
position/orientation and linear/angular velocities
Draw body in new position and repeat
Upcoming Topics
• Collisions
• 3-dimensional rigid bodies (inertia
tensors)
• Forces (centripetal, centrifugal,
viscosity, friction, contact)
• Constrained dynamics (linked bodies)