Physics Simulation CSE 191A: Seminar on Video Game Programming Lecture 4: Physics Simulation UCSD, Spring, 2003 Instructor: Steve Rotenberg.

Slides:



Advertisements
Similar presentations
AP Physics C Mechanics Review.
Advertisements

Real-Time Game Physics
Newton’s First Law of Motion Newton’s First Law of Motion.
Newton’s Laws 1. F. Newton’s Laws of Motion  Kinematics is the study of how objects move, but not why they move.  Sir Isaac Newton turned his attention.
Section 1: The Nature of Force Force – a push or pull on an object; causes an object to accelerate. 0 m/s 3 m/s.
Summer School 2007B. Rossetto1 5. Kinematics  Piecewise constant velocity t0t0 tntn titi t i+1 x(t) x(t i ) h t x i = v(t i ). h Distance runned during.
Chapter 3 Biomechanics Concepts I
Physics 1901 (Advanced) A/Prof Geraint F. Lewis Rm 557, A29
1Notes  Demetri Terzopoulos talk: Thursday, 4pm Dempster 310.
Conservation of Momentum
Chapter 12: Rolling, Torque and Angular Momentum.
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.
Cloth Simulation CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
Physics 1A, Section 2 November 15, Translation / Rotation translational motionrotational motion position x angular position  velocity v = dx/dt.
Particle Systems CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2004.
Semester Physics 1901 (Advanced) A/Prof Geraint F. Lewis Rm 560, A29
Cloth Simulation CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2004.
ISAAC NEWTON AND THE FORCE Dynamics. Kinematics vs Dynamics Kinematics – the study of how stuff move  Velocity, acceleration, displacement, vector analysis.
Computer graphics & visualization Rigid Body Simulation.
Sports Mechanics Principles
Feature-length films: Games: Desktop Animations: Computer Animation.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Physically Based Animation.
Nahdir Austin Honors Physics Period 2.  Force: A push or pull on an object (something that can accelerate objects.  A force is measured by a Newton.
Physically Based Animation and Modeling
Spring Topic Outline for Physics 1 Spring 2011.
Chapter 12 Linear Kinematics of Human Movement
Chapter 5 Newton’s Second Law of Motion – Force and Acceleration
Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Game Physics – Part I Dan Fleck Coming up: Rigid Body Dynamics.
ESS 303 – Biomechanics Linear Kinetics. Kinetics The study of the forces that act on or influence movement Force = Mass * Acceleration: F = M * a Force.
Spring Rigid Body Simulation. Spring Contents Unconstrained Collision Contact Resting Contact.
Chapter 9: Rotational Dynamics
Newton’s 2 nd Law. Enduring Understanding: Studying dynamics (causes of motion) has had a profound effect on the way humans view their world. Essential.
DYNAMICS The motion of a body is affected by other bodies present in the universe. This influence is called an interaction. vectors: force torque impulse.
Angular Kinetics After reading this chapter, the student should be able to: Define torque and discuss the characteristics of a torque. State the angular.
Chapter 4 Dynamics: Newton’s Laws of Motion
Chapter 4-Newton’s Laws of Motion. Introduction  Dynamics-The study of the forces that change or produce motion. The “why” of motion.  The work of Sir.
Equation of Motion for a Particle Sect nd Law (time independent mass): F = (dp/dt) = [d(mv)/dt] = m(dv/dt) = ma = m(d 2 r/dt 2 ) = m r (1) A 2.
Advanced Computer Graphics Rigid Body Simulation Spring 2002 Professor Brogan.
Joint Reaction Forces Muscle Moments Joint Power
Spring Rigid Body Simulation. Spring Contents Unconstrained Collision Contact Resting Contact.
Dynamics!.
Basic Information: Force: A push or pull on an object Forces can cause an object to: Speed up Slow down Change direction Basically, Forces can cause an.
Robotics II Copyright Martin P. Aalund, Ph.D.
CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Rigid Body Dynamics CSE169: Computer Animation
Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’
Kinematics JoseDwayneLuke Motion Some of the equations that we use are: v=d total/ t total Vave= vo +vf / 2 a= vf- vo / tf –to d=vot+1/2at2 Vf=vo + at.
Dynamics. Motion with Regard to Mass Particle Dynamics Mass concentrated in point Newton’s Equation Governs Motion f = M x.
Physics 111 Lecture Summaries (Serway 8 th Edition): Lecture 1Chapter 1&3Measurement & Vectors Lecture 2 Chapter 2Motion in 1 Dimension (Kinematics) Lecture.
Fundamentals of Computer Animation Rigid Body Simulation (1)
Feature-length films: Games: Desktop Animations:.
UNIT 6 Rotational Motion & Angular Momentum Rotational Dynamics, Inertia and Newton’s 2 nd Law for Rotation.
EFFECTS OF COMPUTER SIMULATION ON PERFORMANCE AND RETENTION OF SECONDARY SCHOOL PHYSICS STUDENTS IN MINNA NIGER STATE BY POPOOLA OLABODE 2009/1/34123BE.
Advanced Computer Graphics Rigid Body Simulation
Physically Based Simulations For Games
Section 1: The Nature of Force
Newton’s Laws.
Lecture Rigid Body Dynamics.
Lecture 16 Newton Mechanics Inertial properties,Generalized Coordinates Ruzena Bajcsy EE
EECE 478 Game Physics.
Newton’s Laws Of Motion
Newton’s Laws of Motion
Manipulator Dynamics 2 Instructor: Jacob Rosen
Dynamics: Newton’s Laws of Motion (Ch. 12)
BIOMECHANICS CONCEPTS
Rigid Body Dynamics (unconstrained)
Introduction to Fluid Mechanics
Presentation transcript:

Physics Simulation CSE 191A: Seminar on Video Game Programming Lecture 4: Physics Simulation UCSD, Spring, 2003 Instructor: Steve Rotenberg

Physics Simulation Particles Rigid bodies Deformable bodies Fluid dynamics Vehicle dynamics Characters

Definitions Kinematics: The study of motion without consideration of the underlying forces Dynamics: Study of physical motion (or more abstractly, the study of change in physical systems) Forward Dynamics: Computing motion resulting from applied forces Inverse Dynamics: Computing forces required to generate desired motion Mechanics, Statics, Kinetics

Particles

Kinematics of Particles Positionx Velocityv = dx/dt Accelerationa = dv/dt = d 2 x/dt 2

Motion Under Uniform Acceleration Accelerationa=a 0 Velocity Position

Mass & Momentum Massm Momentump = mv Forcef = dp/dt = m(dv/dt) = ma

Forces Forces cause change in momentum (accelerations) Multiple forces can add up to a single total force:

Newton’s Laws 1. A body at rest tends to stay at rest, and a body in motion tends to stay in motion, unless acted upon by some force. 2. Forces lead to changes in momentum and therefore accelerations: f=ma 3. Every action has an equal and opposite reaction. f ij =-f ji

Gravity Gravity near Earth’s surface is constant: f=mg(g = -9.8 m/s 2 ) Gravity for distant objects: f=Gm 1 m 2 /r 2 (G=6.673× m 3 /kg·s 2 )

Particle Simulation UpdateParticle(float time) { Force=ComputeTotalForce(); Momentum=Momentum+Force*time; Velocity=Momentum/Mass; Position=Position+Velocity*time; }

Integration Explicit Euler method: v=v 0 +aΔt x=x 0 +vΔt Many other methods: Implicit Euler Runge-Kutta Adams, Adams-Moulton, Adams-Bashforth Crank-Nicholson Multipoint Leapfrog DuFort-Frankel

Simulation Issues Stability Accuracy Convergence Performance

Forces

Spring-Damper Spring-damper:f=-kx-cv k=spring constant x=distance from rest state c=damping factor v=velocity along spring axis

Aerodynamic Drag Drag force:f=(1/2)ρa c c d v 2 ρ=fluid density a c =cross sectional area c d =coefficient of drag (geometric constant based on shape of object, usually between 0 and 1, but can be higher) v=velocity of the object relative to velocity of the fluid Note: for simple cases, (1/2)ρa c c d is constant

Friction Static friction:f ≤ f n μ s Dynamic friction:f = f n μ d f n =normal force μ s =coefficient of static friction μ d =coefficient of dynamic friction

Force Fields Generic force fields can be created that use arbitrary rules to define a force at some location:f=f(x) Examples: vortex, attractors, turbulence, torus…

Collisions: Impulse Impulse: J=Δp An impulse is a finite change in momentum Impulses are essentially large forces acting over a small time Modified momentum update: p=p 0 +fΔt+J

Rigid Bodies

Rotational Inertia

Principle Axes

Angular Momentum L=Iω = AI 0 A -1 ω L=angular momentum I=rotational inertia ω=angular velocity A=3x3 orientation matrix

Forces & Torques τ=dL/dt A torque is a change in angular momentum (similar to a force which is a change in linear momentum)

Offset Forces Torque resulting from offset force: τ=r×f Total force: Total torque:

Rigid Body Simulation UpdateRigidBody(float time) { Force=ComputeTotalForce(); Torque=ComputeTotalTorque(); Momentum=Momentum+Force*time; Velocity=Momentum/Mass; Position=Position+Velocity*time; AngMomentum=AngMomentum+Torque*time; Matrix34 I=Matrix*RotInertia*Matrix.Inverse(); AngVelocity=I.Inverse()*AngMomentum; Matrix.Rotate(AngVelocity*time); }

Rigid Body Collisions

Advanced Topics Contact: resting, sliding, rolling, stacking Articulated bodies Deformable bodies Cloth Fracture Fluid dynamics Vehicle dynamics

Using Physics in Games Use physics for the things it is good at Cheating Clamping

Conclusion

Preview of Next Week Character animation Skeletons Skin Inverse kinematics Animation Locomotion

Physics References Coutinho, “Dynamic Simulation of Multibody Systems” Bourg, “Physics for Game Developers”