Game Development Reference
In-Depth Information
Figure 13.23
Three different choices of tangents for the middle knot, leading to three different interpolating
splines
which shows three control points and three different choices we could use
for the tangents.
The following sections discuss a family of techniques that can be used
to pick tangents that result in “good” interpolating splines. First, Sec-
tion 13.9.1 discuss the Catmull-Rom spline, which is a simple and straight-
forward technique. Then Section 13.9.2 considers TCB splines, a gener-
alization of the Catmull-Rom form and a hybrid that exposes additional
“sliders” to the user to adjust the shape of the curve in a (hopefully) more
intuitive manner without resorting to direct geometric specification of the
tangents. Finally, Section 13.9.3 lists a few options for dealing with the
endpoints.
When reading the following sections, keep in mind that all of these
splines are still Hermite splines. We are just introducing various techniques
for autocalculating the tangents. Once the tangents have been determined,
the spline is no different than any other Hermite spline.
13.9.1
Catmull-Rom Splines
Looking at Figure 13.23, it seems obvious which of the three choices of
tangents is the most natural: the one in the middle. Why is this? The
vector from the previous knot k i−1 to the next knot k i+1 is a horizontal
line, and therefore it makes sense that our tangents should be horizontal.
So it looks like one heuristic we could use to pick good tangents would be to
make the tangents at a knot be parallel to the line between the previous and
next knot. (Note that our example is slightly contrived in that the middle
knot happens to be halfway between its neighbors, which is a special case.
However, the fact that the neighbors lie on a horizontal line is not a special
case, since we can always rotate our perspective to view the points in this
configuration.)
 
Search WWH ::




Custom Search