Rigid Body Dynamics Jim Van Verth

Slides:



Advertisements
Similar presentations
Numerical Integration
Advertisements

AP Physics C Mechanics Review.
Our Friend the Dot Product
Numeric Integration Methods Jim Van Verth Red Storm Entertainment
Dynamics 101 Jim Van Verth Red Storm Entertainment
Affine Transformations Jim Van Verth NVIDIA Corporation
Collision Response Jim Van Verth
Constrained Dynamics Marq Singer
Affine Transformations
MAE 242 Dynamics – Section I Dr. Kostas Sierros. Problem 1.
Manipulator Dynamics Amirkabir University of Technology Computer Engineering & Information Technology Department.
Integration Techniques
PHY205 Ch14: Rotational Kin. and Moment of Inertial 1.Recall main points: Angular Variables Angular Variables and relation to linear quantities Kinetic.
Rotation and Torque Lecture 09 Thursday: 12 February 2004.
Dynamics of Rotational Motion
Game Physics – Part II Dan Fleck. Linear Dynamics Recap  Change in position (displacement) over time is velocity  Change in velocity over time is acceleration.
1Notes  Demetri Terzopoulos talk: Thursday, 4pm Dempster 310.
Robot Dynamics – Newton- Euler Recursive Approach ME 4135 Robotics & Controls R. Lindeke, Ph. D.
ME Robotics Dynamics of Robot Manipulators Purpose: This chapter introduces the dynamics of mechanisms. A robot can be treated as a set of linked.
Ch. 7: Dynamics.
Game Physics Chris Miles. The Goal To learn how to create game objects with realistic physics models To learn how to simulate aspects of reality in order.
Euler Rotation. Angular Momentum  The angular momentum J is defined in terms of the inertia tensor and angular velocity. All rotations included  The.
Manipulator Dynamics Amirkabir University of Technology Computer Engineering & Information Technology Department.
Physics 106: Mechanics Lecture 02
Physics 218, Lecture XIX1 Physics 218 Lecture 19 Dr. David Toback.
Computer graphics & visualization Rigid Body Simulation.
Dynamics 101 Jim Van Verth Red Storm Entertainment
Physics for Game Developers Jim Van Verth Christer Ericson Squirrel Eiserloh Gino van den Bergen Erin Catto Marq Singer.
Spring Topic Outline for Physics 1 Spring 2011.
Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Game Physics – Part IV Moving to 3D
Game Physics – Part I Dan Fleck Coming up: Rigid Body Dynamics.
Spring Rigid Body Simulation. Spring Contents Unconstrained Collision Contact Resting Contact.
PHY221 Ch14: Rotational Kin. and Moment of Inertial 1.Recall main points: Angular Variables Angular Variables and relation to linear quantities Kinetic.
Numerical Integration and Rigid Body Dynamics for Potential Field Planners David Johnson.
4 - 1 Kinematics of Particles Kinematics is the study of motion without reference to the force which produced the motion. First, we will study the kinematics.
Lecture Fall 2001 Physically Based Animation Ordinary Differential Equations Particle Dynamics Rigid-Body Dynamics Collisions.
Rotational Mechanics. Rotary Motion Rotation about internal axis (spinning) Rate of rotation can be constant or variable Use angular variables to describe.
Sect 5.6: Torque-Free Motion of a Rigid Body
Advanced Computer Graphics Rigid Body Simulation Spring 2002 Professor Brogan.
The center of gravity of an object is the point at which its weight can be considered to be located.
Equilibrium,Torque and Angular Momentum Lecture 10 Tuesday: 17 February 2004.
Chapter 11 Angular Momentum. Angular momentum plays a key role in rotational dynamics. There is a principle of conservation of angular momentum.  In.
Rotational Kinetic Energy An object rotating about some axis with an angular speed, , has rotational kinetic energy even though it may not have.
Rotational Dynamics. When you apply a force to a rigid body (i.e. one that maintains its form with no internal disruption) at a distance from an axis,
Moment Of Inertia.
Spring Rigid Body Simulation. Spring Contents Unconstrained Collision Contact Resting Contact.
1 Rotation of a Rigid Body Readings: Chapter How can we characterize the acceleration during rotation? - translational acceleration and - angular.
1 Work in Rotational Motion Find the work done by a force on the object as it rotates through an infinitesimal distance ds = r d  The radial component.
Geometric Algebra Dr Chris Doran ARM Research 3. Applications to 3D dynamics.
CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Rigid Body Dynamics CSE169: Computer Animation
Physics 3210 Week 11 clicker questions. Multiplication of a vector by a matrix A is a linear transformation What happens to an eigenvector of A under.
Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’
Dynamics. Motion with Regard to Mass Particle Dynamics Mass concentrated in point Newton’s Equation Governs Motion f = M x.
Rotational Motion – Kinematics, Moment of Inertia, and Energy AP Physics 1.
Chapter 17 Rigid Body Dynamics. Unconstrained Motion: 3 Equations for x, y, rotation.
Honours Graphics 2008 Session 9. Today’s focus Physics in graphics Understanding:
Fundamentals of Computer Animation Rigid Body Simulation (1)
1 7. Rotational motion In pure rotation every point of an object moves in a circle whose center lies on the axis of rotation (in translational motion the.
Rotational Equilibrium and Dynamics Rotation and Inertia.
Advanced Computer Graphics Rigid Body Simulation
Manipulator Dynamics 1 Instructor: Jacob Rosen
Lecture Rigid Body Dynamics.
Lecture 16 Newton Mechanics Inertial properties,Generalized Coordinates Ruzena Bajcsy EE
General Physics I Rotational Motion
Manipulator Dynamics 2 Instructor: Jacob Rosen
Rigid Body Dynamics (unconstrained)
Rotational Equilibrium and Dynamics
Presentation transcript:

Rigid Body Dynamics Jim Van Verth

Essential Math for Games Rigid Body Dynamics Simplest form of physical simulation Gets you a good way towards making a more realistic looking game Not that hard, either

Essential Math for Games Rigid Body Objects we simulate will not deform Brick vs. clay Fixed model: only change position and orientation

Essential Math for Games Dynamics Want to move objects through the game world in the most realistic manner possible Applying velocity not enough – need ramp up, ramp down – acceleration Same with orientation

Essential Math for Games Calculus Review Have function y(t) Function y'(t) describes how y changes as t changes (also written dy/dt ) y'(t) gives slope at time t y(t)y(t) y'(t) y t

Essential Math for Games Calculus Review Our function is position: Derivative is velocity: Derivative of velocity is acceleration

Essential Math for Games Basic Newtonian Physics All objects affected by forces  Gravity  Ground (pushing up)  Other objects pushing against it Force determines acceleration ( F = ma ) Acceleration changes velocity ( ) Velocity changes position ( )

Essential Math for Games Basic Newtonian Physics Assume acceleration constant, then Similarly

Essential Math for Games Basic Newtonian Physics Key equations Note: force is derivative of momentum P  Remember for later – easier for angular

Essential Math for Games Basic Newtonian Physics General approach  Compute all forces on object, add up  Compute acceleration (divide total force by mass)  Compute new position based on old position, velocity, acceleration  Compute new velocity based on old velocity, acceleration

Essential Math for Games Newtonian Physics Works fine if acceleration is constant Not good if acceleration dependant on position or velocity – changes over time step E.g. spring force: F spring = – kx E.g. drag force: F drag = – m  v

Essential Math for Games Analytic Solution Can try and find an analytic solution  I.e. a formula for x and v  In case of simple drag:  But not always a solution  Or may want to try different simulation formulas

Essential Math for Games Numeric Solution Problem: Physical simulation with force dependant on position or velocity Start at x(0) = x 0, v(0) = v 0 Only know: Basic solution: Euler’s method

Essential Math for Games Euler’s Method Idea: we have the derivative ( x or v ) From calculus, know that Or, for sufficiently small h :

Essential Math for Games Euler’s Method Can re-arrange as: Gives us next function value in terms of current value and current derivative

Essential Math for Games Final Formulas Using Euler’s method with time step h

Essential Math for Games What About Orientation? Force ( F ) applies to center of mass* of object – creates translation Torque (  ) applies to offset from center of mass – creates rotation Add up torques just like forces

Essential Math for Games Force vs. Torque (cont’d) To compute torque, take cross product of vector r (from CoM to point where force is applied), and force vector F Applies torque ccw around vector r F

Essential Math for Games Other Angular Equivalents Force F vs. torque  Momentum P vs. angular momentum L Velocity v vs. angular velocity  Position x vs. orientation  Mass m vs. moments of inertia J

Essential Math for Games Why L ? Difficult to compute angular velocity from angular acceleration Compute ang. momentum by integrating torque Compute ang. velocity from momentum Since then

Essential Math for Games Moments of Inertia Moments of inertia are 3 x 3 matrix, not single scalar factor (unlike m ) Many factors because rotation depends on shape and density Describe how object rotates around various axes Not easy to compute Change as object changes orientation

Essential Math for Games Computing J Can use moments of inertia for closest box or cylinder Can use sphere (one factor: 2mr 2 /5 ) Or, can just consider rotations around one axis and fake(!) the rest With the bottom two you end up with just one value… can simplify equations

Essential Math for Games Computing J Alternatively, can compute based on geometry Assume constant density, constant mass at each vertex Solid integral across shape See Eberly for more details  Also at

Essential Math for Games Using J in World Space Remember, J computed in local space, must transform to world space If using rotation matrix , use formula If using quaternion, convert to matrix

Essential Math for Games Computing New Orientation Have matrix  and vector  How to integrate? Convert  to give change in   Change to linear velocity at tips of basis vectors  One for each basis gives 3x3 matrix  Can use Euler's method then

Essential Math for Games Computing New Orientation Example:

Essential Math for Games Computing New Orientation   r gives linear velocity at r Could do this for each basis vector Better way:  Use symmetric skew matrix to compute cross products  Multiply by orientation matrix

Essential Math for Games Computing New Orientation If have matrix , then where

Essential Math for Games Computing New Orientation If have quaternion q, then See Baraff or Eberly for derivation where

Essential Math for Games Computing New Orientation We can represent wq as matrix multiplication where Assumes q = (w, x, y, z)

Essential Math for Games Angular Formulas

Essential Math for Games Reducing Error Keep time step as small as possible Clamp accelerations, velocities to maximum values – avoid large forces If velocity, acceleration very small, set to zero (avoids little shifts in position) Damping acceleration based on velocity (i.e. friction) can help

Essential Math for Games Improving Performance If not moving, don’t simulate Only do as much as you have to If you can fake it, do so  objects on ground, don’t bother with gravity  only rotate around z, don’t bother with J  simple drag instead of full friction model

Essential Math for Games References Burden, Richard L. and J. Douglas Faires, Numerical Analysis, PWS Publishing Company, Boston, MA, Hecker, Chris, “Behind the Screen,” Game Developer, Miller Freeman, San Francisco, Dec Jun Witken, Andrew, David Baraff, Michael Kass, SIGGRAPH Course Notes, Physically Based Modelling, SIGGRAPH Eberly, David, Game Physics, Morgan Kaufmann, 2003.