Mark Nelson Movement and physics Fall 2013

Slides:



Advertisements
Similar presentations
Rotation, Angular Momentum and Gravity
Advertisements

Real-Time Game Physics
Motion.
Arc-length computation and arc-length parameterization
Chapter 2: Describing Motion in 1-D
Parametric Equations Local Coordinate Systems Curvature Splines
Forces and Newton’s Laws. Force A force is what we call a push, or a pull, or any action that has the ability to change motion. There are two units of.
Forces & Motion Unit Vocabulary
Chapter 5 Circular Motion.
Computer Animation Algorithms and Techniques
1Notes  Assignment 0 is being marked  Textbook reference for arc-length parameterization:  Section 3.2.
Molecular Dynamics Classical trajectories and exact solutions
Chapter 4 - Motion. Frames of Reference Is this train in motion? How do you know?
Physics 2011 Chapter 2: Straight Line Motion. Motion: Displacement along a coordinate axis (movement from point A to B) Displacement occurs during some.
Sect. 2-5: Motion at Constant Acceleration
CS 4730 Physical Simulation CS 4730 – Computer Game Design.
Chapter 2 Preview Objectives One Dimensional Motion Displacement
Describing Motion: Kinematics in One Dimension AP Physics Chapter 2.
Kinematics: Motion in One Dimension
Motion in One Dimension Average Versus Instantaneous.
MOTION BY MARK AND ZYAN. Section 1vocab Frame of reference – Is a system of objects that are not moving with respect to one another. Relative motion –
Game Physics – Part I Dan Fleck Coming up: Rigid Body Dynamics.
Chapter 6: Circular Motion and Gravitation
Sect. 2-5: Motion at Constant Acceleration. Motion with Constant Acceleration Many practical situations: –The magnitude of the acceleration is uniform.
INTEGRATED SCIENCE CHAPTER 11.
MOTION. Chapter Four: MotionMotion  4.1 Position, Speed and Velocity  4.2 Graphs of Motion  4.3 Acceleration.
Motion  1 Position, Speed and Velocity  2 Graphs of Motion  3 Acceleration.
KINEMATICS OF PARTICLES Kinematics of Particles This lecture introduces Newtonian (or classical) Mechanics. It concentrates on a body that can be considered.
Linear Kinematics : Velocity & Acceleration. Speed Displacement - the change in position in a particular direction and is always a straight line segment.
 Define the term motion.  Give an example of something in motion.  How do we know an object is in motion?  How do we know if we are in motion even.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Interpolating Values.
Momentum & Impulse Level 1 Physics.
Circular Motion Objectives Students should be able to: (a) define the radian; (b) convert angles from degrees into radians and vice versa;
Tangential and Centripetal Accelerations
Calculus and Newton’s 2 nd Law Sometimes, we want to find a formula for the velocity (or position) of an object as a function of time. 公式.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Optimization & Constraints Add mention of global techiques Add mention of calculus.
motiontranslationaverage speed Rotation kinematics center of mass Center of gravity gravitational force Gravity displacement direction Vector quantity.
CS-378: Game Technology Lecture #13: Animation Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
Motion with Constant Acceleration. Constant Acceleration In many practical situations: –The magnitude of the acceleration is uniform (constant) –The motion.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Physics for Games Spring 2012.
Calculations in Physics and Game Engines Games Fundamentals © by Jarek Francik Kingston University, London
CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves Jinxiang Chai.
Chapter 2 Describing Motion: Kinematics in One Dimension.
Trajectory Generation
City College of New York 1 John (Jizhong) Xiao Department of Electrical Engineering City College of New York Mobile Robot Control G3300:
Circular Motion and Other Applications of Newton’s Laws
CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai.
CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai.
Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.
Unit 2- Force and Motion Vocabulary- Part I. Frame of Reference  A system of objects that are not moving with respect to each other.
Kinematics: Linear Motion in One Dimension Class 1.
Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’
Ship Computer Aided Design
Chapter 3 Accelerated Motion. Introduction In this chapter we will examine acceleration and define it in terms of velocity. We will also solve problems.
Motion with Constant Acceleration. Constant Acceleration In many practical situations: –The magnitude of the acceleration is uniform (constant) –The motion.
Rick Parent - CIS681 Interpolation of a time-space curve Interpolation (of a curve in space) Speed control along curve Reparameterizing according to arc.
Chapter 4 Linear Motion.
MOTION. Chapter Four: Motion  4.1 Position, Speed and Velocity  4.2 Graphs of Motion  4.3 Acceleration.
Particle Kinematics Direction of velocity vector is parallel to path Magnitude of velocity vector is distance traveled / time Inertial frame – non accelerating,
Get your software working before putting it on the robot!
Circular Motion and the Law of Universal Gravitation.
Chapter 3 Describing Motion: Kinematics in One Dimension.
Physics Chapter 2 Notes. Chapter Mechanics  Study of the motion of objects Kinematics  Description of how objects move Dynamics  Force and why.
MOTION.
CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves
Integral as Net Change Chapter 8.1.
CSCE 441: Keyframe Animation/Smooth Curves (Cont.)
Straight Line Motion (continued)
Motion, Speed, and Velocity
Presentation transcript:

Mark Nelson Movement and physics Fall

Movement  You will probably want some things moving  Lots of ways to do that  General tradeoff between physics and animation  And hybrid approaches

Basic movement model  Recall Pong  Velocity per object  Update position per frame  Control by changing an object’s velocity:  Rotate  Speed up / slow down

Smoothed movement  Instantaneous velocity changes aren’t always great  ”Natural” motion is often non-linear  Mario moving platforms speed up and slow down at path ends  Even blinking lights aren’t always linear

MacBook sleep indicator LED curve

Simple smoothing  Send velocity changes via an API  Now, each game-loop iteration:  Update position based on velocity  Update velocity based on curve  Can be pre-programmed animation (platform movement)  Or, reactive (e.g. with some lag)

Physics-based smoothing  The reactive version is basically velocity+acceleration:  Objects have velocity  Positions are updated based on velocity (1st derivative of position)  Velocities are updated based on acceleration (2nd derivative of position)  Acceleration can be the basic unit, or computed from force  F = ma, so equivalent for a constant-mass object

Physics versus animation  Why not always physics?

Inverse kinematics  Kinematics:  How objects move in reaction to forces  Inverse kinematics:  How to apply forces to get objects to move in specific ways  Hard in general

Curve-following  Say we want to follow a specific curved path  Robotics-style reactive controller:  If we’re off the path, apply corrective velocity  Produces smooth, physically realistic, but ”laggy” path following  Can follow more closely:  Predictive controller, e.g. start turning a bit before a turn  Analytical solution, like calculating a satellite’s thrust schedule

Some more pros/cons  When not physics:  Weird emergent effects to debug  Want effects you don’t want to fully simulate, e.g. tractor-beam motion  When physics:  Want unscripted interaction between animations and other objects  E.g. Platform on a pre-animated path, but can be knocked off-course by player colliding with it

Some animation approaches  How do we follow a path?  Waypointing  Animator gives specific points on a path  Animation system moves objects between them  Simplest is just drawing straight lines, but often want smoothing

Parametric curves  General representation of paths  Function X(t) gives object position from t_start to t_end

Bezier curves  Probably the most common parameterized curve  Quadratic Bezier:  X(t) = (1-t) 2 P 0 + 2(1-t)P 1 +t 2 P 2

Some facts about parametric curves  speed(t) = |X’(t)|  distance(t) = integrate speed(t) from t_start to t Plus, lots more useful relationships, e.g. curvature

Constant-speed motion  Often want to move at constant speed along a curve  Or at least, want to control our speed separately, by varying t  Not always easy to define a curve so that it comes with constant speed(t)  Solve by noticing:  Constant speed means constant distance traveled

Constant-speed motion  Reparameterize by arc length  Choose desired arc position p we want to be at  Solve distance(t) = p  Done by finding root of distance(t) – p = 0  (Requires numeric integration, usually Newton’s method)

Bezier paths

Bezier curves  Notice that almost all Bezier curves don’t start out as constant-speed curves!  Also, can sometimes have weird artifacts  Loops, backwards travel  More common in higher-degree curves  May be inappropriate, or need more constraints, if you have obstacles

Physics engine  [see other slides]

2d platformer physics  Similar general principles  But some things can be simplified  Grid-based methods  Pixel-based methods  Collision response  Bouncing off, stopping  Special-case being ”on” a surface

2d platformer physics