Game Development Reference
In-Depth Information
notation y i (t) denote the quadratic curve between y i and y i+2 , and so on.
In other words, the superscript indicates the recursion level in the divide-
and-conquer algorithm (and also the degree of the polynomial), and the
subscript indexes along the length of the curve.
Take a look at the first quadratic curve y 1 (t) that interpolates y 1 , y 2 ,
and y 3 . It is formed by blending together the two lines containing the first
two linear segments. An example of such blending is shown in Figure 13.3.
(This figure doesn't use the data from our S example; it's a less symmetric
case that better illustrates the blending process.) Notice that each curve
segment is an interval from an infinite curve that is defined for any value
of t.
Figure 13.3
Creating a quadratic curve as a
blend of two linear segments
according to Aitken's algorithm
Now let's look at the math behind this. It's all linear interpolation. The
easiest are the linear segments, which are defined by linear interpolation
between the adjacent control points:
Linear interpolation
between two control
points
y 1 (t) = (t 2
− t)y 1 + (t − t 1 )y 2
t 2 − t 1
y 2 (t) = (t 3
− t)y 2 + (t − t 2 )y 3
t 3 − t 2
,
.
The quadratic curve is only slightly more complicated. We just linearly
interpolate between the line segments:
Linear interpolation of
lines yields a quadratic
curve
y 1 (t)
y 2 (t)
y 1 (t) = (t 3 − t)
+ (t − t 1 )
.
t 3 − t 1
Hopefully you can see the pattern—each curve is the result of linearly
interpolating two curves of lesser degree. Aitken's algorithm can be sum-
marized succinctly as a recurrence relation.
Search WWH ::




Custom Search