1 Roller coaster Jernej Barbic, CSCI 480, USC The programming assignment involves creating a 3D roller coaster animation We must model the 3D curve describing.

Slides:



Advertisements
Similar presentations
AP C UNIT 3 WORK & ENERGY.
Advertisements

PHY126 Summer Session I, 2008 Most of information is available at:
Arc-length computation and arc-length parameterization
Physics 430: Lecture 7 Kinetic and Potential Energy
Chapter 9: Vector Differential Calculus Vector Functions of One Variable -- a vector, each component of which is a function of the same variable.
Parametric Equations Local Coordinate Systems Curvature Splines
Kinetics of Particles Impulse and Momentum.
Conservative vs. Non-conservative Forces
Physics of Rolling Ball Coasters Cross Product Torque Inclined Plane Inclined Ramp Curved Path Examples.
1Notes  Assignment 0 is being marked  Textbook reference for arc-length parameterization:  Section 3.2.
Phy100: More on Energy conservation Mechanical energy (review); Goals: Work done by external forces; Understand conservation law for isolated systems.
1Notes  Assignment 0 marks should be ready by tonight (hand back in class on Monday)
MANE 4240 & CIVL 4240 Introduction to Finite Elements Numerical Integration in 1D Prof. Suvranu De.
1/18/ L IAP 2007  Last Lecture  Pendulums and Kinetic Energy of rotation  Today  Energy and Momentum of rotation  Important Concepts  Equations.
Physics 218, Lecture XI1 Physics 218 Lecture 11 Dr. David Toback.
Physics of Rolling Ball Coasters
Conservation of Energy
Gravitational Potential energy Mr. Burns
Chapter 15 Oscillatory Motion.
Chapter 12: Energy & Work Unit Integrated Science I.
SE-280 Dr. Mark L. Hornick Numerical Integration.
T. K. Ng, HKUST Lecture IV. Mechanics of rigid bodies.
Chapter 7 Work and Energy
Central Force Motion Chapter 8
Momentum, Impulse, And Collisions
Chapters 10, 11 Rotation and angular momentum. Rotation of a rigid body We consider rotational motion of a rigid body about a fixed axis Rigid body rotates.
Kinetic Energy, Work, Power, and Potential Energy
ME 2304: 3D Geometry & Vector Calculus Dr. Faraz Junejo Line Integrals.
Kinetic Energy, Work, Power, and Potential Energy
Simpson Rule For Integration.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Prentice Hall Slide 1- 1.
Chapter 10 Rotation of a Rigid Object about a Fixed Axis.
Chapter 5 Force and Motion In Chapters 2 and 4 we have studied “kinematics,” i.e., we described the motion of objects using parameters such as the position.
Introduction : In this chapter we will introduce the concepts of work and kinetic energy. These tools will significantly simplify the manner in which.
Questions From Reading Activity? Big Idea(s):  The interactions of an object with other objects can be described by forces.  Interactions between.
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.
When the axis of rotation is fixed, all particles move in a circle. Because the object is rigid, they move through the same angular displacement in the.
110/27/ :47 Graphics II Animation Introduction and Motion Control Session 6.
The Fundamental Theorem for Line Integrals. Questions:  How do you determine if a vector field is conservative?  What special properties do conservative.
Sect. 6-5: Conservative Forces. Conservative Force  The work done by that force depends only on initial & final conditions & not on path taken between.
Chapter 10 Rotational Motion.
Chapter 15: Oscillations
Systems and energy. Equations For any closed system that undergoes a change, the total energy before the change is the same as the total energy after.
Quadrature rules 1Michael Sokolov / Numerical Methods for Chemical Engineers / Numerical Quadrature Michael Sokolov ETH Zurich, Institut für Chemie- und.
4.7 Improper Integrals 1 For integration, we have assumed 1. limits of integration are finite, 2. integrand f(x) is bounded. The violation of either of.
Representing Motion. Motion We are looking to ____________and ____________an object in motion. Three “rules” we will follow: –The motion is in a __________________.
CS 551/651 Advanced Graphics Arc Length. Assignment 1 Due Week from Thursday Building a Cubic Bézier curve OpenGL/Glut Insert up to 100 points Render.
Conservation of Energy. Equations For any closed system that undergoes a change, the total energy before the change is the same as the total energy after.
Ideas about Work and Energy What exactly is energy?
Antiderivatives and Indefinite Integration
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.
Conservation of Energy
Kinematics The branch of mechanics that studies the motion of a body without caring about what caused the motion.
Work, Energy and Power Ms Houts AP Physics C Chapters 7 & 8.
Accelerated Motion. is changing either the speed or direction, or both, of motion. Acceleration is the rate of change of velocity, in other words, how.
Chapter 1: Survey of Elementary Principles
Systems and energy pg. 43. Objectives Define a physical system. Calculate the mechanical energy of a physical system. Demonstrate and apply the law of.
Physics Chapter 3 Describing Motion. 3.1 Picturing Motion Motion diagram Operational definition Particle model 3.2 Where and When Coordinate systems Scalar/Vector.
Oscillations. Periodic Motion Periodic motion is motion of an object that regularly returns to a given position after a fixed time interval A special.
Work Done by a Constant Force The work done by a constant force is defined as the distance moved multiplied by the component of the force in the direction.
PHY 151: Lecture Motion of an Object attached to a Spring 12.2 Particle in Simple Harmonic Motion 12.3 Energy of the Simple Harmonic Oscillator.
CSCI480/582 Lecture 9 Chap.2.2 Cubic Splines – Hermit and Bezier Feb, 11, 2009.
Chapter 5.2 Notes Potential Energy.
Integral as Net Change Chapter 8.1.
Devil physics The baddest class on campus AP Physics
CSCE 441: Keyframe Animation/Smooth Curves (Cont.)
Chapter 7 Work and Energy
Presentation transcript:

1 Roller coaster Jernej Barbic, CSCI 480, USC The programming assignment involves creating a 3D roller coaster animation We must model the 3D curve describing the roller coaster, but how? How to make the simulation obey the laws of gravity?

2 Back to the physics of the roller-coaster: mass point moving on a spline v P spline frictionless model, with gravity Velocity vector always points in the tangential direction of the curve

3 Mass point on a spline (contd.) frictionless model, with gravity Our assumption is : no friction among the point and the spline Use the conservation of energy law to get the current velocity W kin + W pot = const = m * g * h max h max reached when |v|=0 W kin = kinetic energy = 1/2 * m * |v| 2 W pot = potential energy = m * g * h h = the current z-coordinate of the mass point g = acceleration of gravity = 9.81 ms -2 m = mass of the mass point

4 Mass point on a spline (contd.) frictionless model, with gravity Given current h, we can always compute the corresponding |v|:

5 Mass point motion* x, v are vectors Assume we know the initial position of a mass point, and velocity v=v(t) Velocity is a 3-dim vector Problem: compute the position of the point at an arbitrary time t 1 Has to integrate velocity over time:

6 Mass point motion (contd.)* Usually, cannot compute the integral symbolically Numerical integration necessary Standard numerical integration routines can be used (i.e. Simpson, Trapezoid, etc.) Integrate each of the coordinates x,y,z separately This is a general approach –For motion on a spline, use arclength parameterization approach instead

7 Arclength Parameterization Problem: parameterizations usually aren’t arc-length How to transform parameterization to an arc-length parameterization? need control over velocity along the curve for animation There are an infinite number of parameterizations of a given curve. Slow, fast, speed continuous or discontinuous, clockwise (CW) or CCW… A special one: arc-length-parameterization: u=s is arc length. We care about these for animation. u=0 s=0 u=1 s=7.4 u=0.8 s=3.7

8 Arclength Parameterization (contd.) Assume a general parameterization p=p(u) p(u) = [x(u), y(u), z(u)] T arclength parameter s=s(u) is the distance from p(0) to p(u) along the curve Distance increases monotonically, hence s=s(u) is a monotonically increasing function It follows from Pitagora’s law that

9 Arclength parameter s The integral for s(u) usually cannot be evaluated analytically, not even for cubic splines (simple polynomials) Has to evaluate the integral numerically Simpson’s integration rule (next slide) Piecewise polynomial definition of the spline means we have to break the integral over individual spline pieces For a fixed spline, can pre-compute function s=s(u) for certain values of u and store it into an array For the next slides, we will assume we have a routine, which computes s(u), given a value of u

10 Simpson integration rule a = x 1, b=x n, h=(b-a)/(n-1) h = x 2k+1 -x 2k = x 2k -x 2k-1 = independent of k n > 3 corresponds to the number of intervals formula exact for a cubic polynomial n MUST be odd Must be able to evaluate the function at the points x 2k-1,x 2k,x 2k+1 Alternative to Simpson: Trapeziod rule – Less accurate: Error is O(h3) – Simpler to compute than Simpson

11 Inverse u=u(s) Inverse problem: Given arclength s, determine the original parameter u Since s=s(u) is monotonically increasing, so is u=u(s) Useful (necessary) for animating motion along the curve Since u=u(t) can only be computed numerically, there is no exact formula for u=u(s)

12 Computing inverse u=u(s) Given arclength s, we can use bisection to determine the corresponding u Can compute (using Simpson’s rule) the function s=s(u) in the forward direction Arclength parameter Original parameter we know we look for u s s=s(u)

13 Computing inverse u=u(s) Bisection(umin,umax,s) /* umin = min value of u umax = max value of u; umin <= u <= umax s = target value */ Forever // but not really forever { u = (umin + umax) / 2; // u = candidate for solution If |s(u)-s| < epsilon Return u; If s(u) > s // u too big, jump into left interval umax = u; Else // t too small, jump into right interval umin = u; } Must have initial guess for the interval containing u

14 Assume we know the size of the current velocity vector |v| of a mass particle on the spline at a given moment in time t –Can obtain this using the laws of physics, as shown before Notation: –u = original parameterization –t = time –s = natural parameterization (i.e. arclength parameterization) We keep current u, t and s in three separate variables How to compute the next position of the particle? Simulating mass point on a spline

15 Simulating mass point on a spline Time step  t We have:  s = |v| *  t and s = s +  s. We want the new value of u, so that can compute new point location Therefore: We know s, need to determine u Here we use the bisection routine to compute u=u(s).

16 Mass point simulation MassPoint(tmax) // tmax = final time /* assume initially, we have t=0 and point is located at u=0 */ u = 0; s = 0; t = 0; While t < tmax { Assert u < 31; // if not, end of spline reached Determine current velocity |v| using physics; s = s + |v| *  t; // compute new arclength u = Bisection(u,u + delta,s); // solve for t p = p(u); // p = new mass point location Do some stuff with p, i.e. render point location, etc. t = t +  t; // proceed to next time step } Assume we have a 32-piece spline, with a general parameterization of u  [0,31]