Game Development Reference
In-Depth Information
(spatially, in a straight line) from one to the other. We say that the function
interpolates the two control points, meaning that it passes through the
control points and can be used to compute intermediate values.
Polynomial interpolation is similar. Given a series of control points, our
goal is to construct a polynomial that interpolates them. The degree of
the polynomial depends on the number of control points. A polynomial of
degree n can be made to interpolate n + 1 control points. For example,
linear interpolation is simply first-degree polynomial interpolation. We're
primarily interested in cubic (third-degree) curves in this chapter, so we are
creating polynomials that interpolate four control points.
In the context of curve design, to say that a curve interpolates con-
trol points is to place specific emphasis on the fact that the curve passes
through the control points. This is to be contrasted with a curve that
merely approximates the control points, meaning it doesn't pass through the
points but is attracted to them in some way. We use the word
“knot” to refer to control points that are interpolated, invoking the meta-
phor of a rope with knots in it. It would seem at first glance that the avail-
ability of an interpolation scheme would make any approximation scheme
obsolete, but we'll see that approximation techniques do have their advan-
tages.
Polynomial interpolation is a classic problem with several well-studied
solutions. Since this is a book on 3D math we cast the discussion primarily
in geometric terms, but be aware that most of the literature on polynomial
interpolation adopts a more general view, because the task of fitting a
function to a set of data points has broad applicability.
To facilitate the discussion we use a particular example curve, shown
in Figure 13.2. It's somewhat like an S turned on its side. We've marked
the four control points on the curve that we are attempting to interpolate.
We've chosen to place the y coordinates on the interval [2,3] for reasons
that will be useful later.
Notice that we must specify not only the position of each control point
(the x and y coordinates), but the time when we want the curve to reach
that control point (the t value). We use the notation that the independent
value (the “time values”) of the control points are named t 1 ,t 2 ,...,t n and
the dependent variables (the spatial coordinate values at those times) are
y 1 ,y 2 ,...,y n . The symbol P stands for the polynomial function that we
seek: y i = P(t i ).
The array of time values t 1 ...t n is known in other contexts as the knot
vector or knot sequence. The word “vector” indicates that the sequence of t
values is an array of numbers, not that these numbers form a vector in the
geometric sense of the word. If the ts are spaced evenly like they are in our
example, then we have a uniform knot vector; otherwise, we say that the
knot vector is nonuniform. (Because it might be confusing, let us clarify
Search WWH ::




Custom Search