CSE 683: Lab 2
Due Wednesday, Oct. 6

LAB 2: Path following with ease-in/ease-out


PRELIMINARY NOTES

Use the main routine and support routines from lab 1.


ASSIGNMENT

Write a program to move an object that follows a curved path through a given set of points starting from a stopped position, accelerating to some maximum speed and then decelerating to a stop at the initial position - and then repeat:

Initialization

  1. set coefficient matrices for beginning segment, interior segments, and end segment - Use the Blended Parabolas or Catmull-Rom spline formulation.
  2. For each segment, loop through points, summing linear distances to create a table of parametric values and summed linear distances to approximate arc length. Because we are using multiple segments, the table might look like:
    segment #u- valuelength
    00.00.0
    00.010.12
    .........
    00.995.35
    01.05.4
    10.015.45
    .........
    11.07.3
    .........
    70.0112.0
    .........
    71.012.5
    OR
    pointlength
    x,y,z0.0
    x,y,z,0.12
    ......
    x,y,z5.35
    x,y,z5.4
    x,y,z5.45
    ......
    x,y,z7.3
    ......
    x,y,z12.0
    ......
    x,y,z12.5
    Compute at least 200 points per segment. If you normalize the lengths in the table so the total length is 1.0 and if the ease-in/ease-out function i/o is also normalized to go from 0.0 to 1.0, then the code is easier to reuse with other ease-in/ease-out procedures.

Simulation

  1. increment a time value, t, that goes from zero to one as the curve is traversed
  2. apply an ease function, s = ease(t), using constant acceleration assumption
  3. search the table created by the initialization routine for the entries s is between
  4. compute the fraction that s is between the two entries.
  5. use the computed fraction to interpolate between the points recorded in the table, u = table(s)
  6. evaluate the interpolation function to produce a point along the curve, p = P(u)

Note that, because 't' monitonically increases, so does 's' and, therefore, so do the indices of the entries retrieved from the table. This should make your search more efficient since you can start the next search from the point of the previous search.


NOTES


Debug Suggestions