
CHAPTER 5 ■ GETTING THE MOST OUT OF VERTICES
507
5-16. Apply Catmull-Rom Interpolation in 3D to
Generate Additional Vertices
The Problem
Givena sequence of points in 3D space, you want to construct a nice, smooth curve that goes
exactly through these points. The black curve in Figure 5-32 shows such a line, while the gray
curve shows what you would get using simple linear interpolation, as described in recipe 5-9.
Figure 5-32. Catmull-Rom spline crossing five points
This can be quite useful in many cases. As an example, you can use it to generate a racing
track, as explained in recipe 5-17. Also, whenever the camera zooms in very closely ...