Particle Kinematics: Translation at Constant Velocity - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

Particle Kinematics: Translation at Constant Velocity

Description:

'Boy Racer Returns!' 8/16/09. 12. 1D motion: example ... Did boy racer win? Problem Solving Procedure. 8/16/09. 13. 2D motion. Specify coordinate system ... – PowerPoint PPT presentation

Number of Views:105
Avg rating:3.0/5.0
Slides: 25
Provided by: claudecch
Category:

less

Transcript and Presenter's Notes

Title: Particle Kinematics: Translation at Constant Velocity


1
Fac. of Comp., Eng. Tech. Staffordshire
University
Programming Physics Engines for Games
Particle KinematicsTranslation at Constant
Velocity
Dr. Claude C. Chibelushi
2
Outline
  • Introduction
  • Motion Formulas
  • Problem Solving Procedure
  • Software Implementation
  • Summary

3
Introduction
  • This lecture considers rigid body which has
  • no (or negligible) angular motion
  • only translational motion considered
  • particle model can be used
  • no net external force

4
Introduction
  • Implication of Newtons 1st and 2nd law of
    motion
  • no net force results in no acceleration
  • hence constant velocity
  • constant magnitude (may be 0)
  • constant direction
  • hence rectilinear motion

5
Motion Formulas
Translation at constant velocity
6
Motion Formulas
  • Average speed
  • distance travelled divided by corresponding
    duration
  • For rectilinear motion distance travelled equals
    displacement magnitude
  • hence, during time interval ?t t2 t1
  • for displacement ?s s2 s1, average velocity
    v ?s / ?t
  • If velocity is constant
  • average velocity equals instantaneous velocity

7
Motion Formulas
Rearranging gives
Generalising p2 to p, and t2 to t (i.e. p is
position at any instant t) gives
If t1 0 (e.g. stop watch reset to 0 at instant
t1) then
8
Motion Formulas
Summary of formula set
No net external force
General case
Special case t1 0
9
Problem Solving Procedure
  • 1D motion
  • Specify coordinate system
  • origin
  • positive and negative direction along axis of
    motion
  • e.g. corresponding to forward or backward movement

10
Problem Solving Procedure
  • 1D motion
  • Specify known motion parameters
  • use signed scalar values
  • Compute unknown motion parameter(s) using
    appropriate formula(s)

11
Problem Solving Procedure
  • 1D motion example
  • Develop physics engine for coolest game ever
  • Boy Racer Returns!

12
Problem Solving Procedure
  • 1D motion example
  • Boy racing car along straight road from Stafford
    to Stoke
  • road length 30 km
  • car speed at departure point 60 km / h
  • no net external force acts on car and driver
    throughout race
  • challenge break the record (20 min)
  • Did boy racer win?

13
Problem Solving Procedure
  • 2D motion
  • Specify coordinate system
  • origin
  • positive and negative direction of x- and
    y-coordinate axes, corresponding to e.g.
  • forward or backward movement
  • up or down movement

14
Problem Solving Procedure
  • 2D motion
  • Specify known motion parameters
  • two signed scalar values for each 2D parameter
  • Compute unknown motion parameter(s) using
    appropriate formula(s)
  • can apply formula(s) to each axis, independently
    of other axis

15
Problem Solving Procedure
  • 2D motion example
  • Develop physics engine for VR application Save
    Dino
  • the last surviving dinosaur is running for its
    life, in a hail of asteroids
  • Dinos path crosses asteroid path
  • player sets asteroid velocity
  • computer advises Dino what speed to avoid

16
Problem Solving Procedure
  • 2D motion example
  • Initial motion parameters
  • position (x, y) data
  • dinosaur (10 km, 210 km)
  • asteroid (10 km, 10 km)
  • asteroid speed 100 km / h (constant)
  • Dinosaur speed constant
  • challenge save Dino! Tell Dino what speed to
    avoid

17
Software Implementation
  • Define data structures
  • possible data grouping
  • // C structure for 2D point or vector
  • typedef struct vector2DTag
  • float x
  • float y
  • Point2D, Vector2D
  • note structure replaced by class in Java

18
Software Implementation
  • possible data grouping (ctd.)
  • // C structure for particle in 2D space
  • typedef struct particle2DTag
  • Point2D pos
  • Vector2D vel
  • Particle2D

19
Software Implementation
  • Declare variables
  • particle position, velocity
  • Particle2D asteroid
  • simulation time
  • long int curTime

20
Software Implementation
  • Initialise known quantities
  • asteroid.pos.x 10000.0
  • asteroid.pos.y 10000.0
  • asteroid.vel.x 70710.7
  • asteroid.vel.y 70710.7

21
Software Implementation
  • Update simulation state (in simulation loop)
  • curTime readComputerTime()
  • timeStep curTime - prevUpdateTime
  • prevUpdateTime curTime
  • asteroid.pos.x asteroid.vel.x timeStep
  • asteroid.vel.y asteroid.vel.y timeStep

22
Software Implementation
  • Update simulation state (ctd.)
  • simplification for fixed time step
  • position increment / decrement at each
    simulation clock tick is constant (calculated
    once outside simulation loop)
  • Vector2D posStep
  • posStep.x asteroid.vel.x timeStep
  • posStep.y asteroid.vel.y timeStep
  • update position (inside simulation loop)
  • asteroid.pos.x posStep.x
  • asteroid.vel.y posStep.y

23
Suggested Reading
  • Relevant parts of Ch. 2, D.M. Bourg, Physics for
    Game Developers, OReilly Associates, 2002.

24
Summary
  • No net external force, hence
  • no motion
  • or rectilinear motion at constant velocity
  • equation of translational motion position update
    step proportional to time interval
  • proportionality factor velocity

25
Summary
  • Problem solving procedure
  • specify coordinate system, and known motion
    parameters
  • compute unknown motion parameter(s)
  • Software implementation
  • define data structures
  • possibly group related variables
  • declare variables and initialise known quantities
  • repeatedly update simulation state
Write a Comment
User Comments (0)
About PowerShow.com