
Demo w/ Source Code for this article IntroductionSplines are a mathematical means of representing a curve, by specifying a series of points at intervals along the curve and defining a function that allows additional points within an interval to be calculated. There are various functions available to approximate a curve, but in this article we will focus on a variety of spline known as the CatmullRom spline. CatmullRom SplinesThe points that define a spline are known as "Control Points". One of the features of the CatmullRom spline is that the specified curve will pass through all of the control points  this is not true of all types of splines.
Given the control points P_{0}, P_{1}, P_{2}, and P_{3}, and the value t, the location of the point can be calculated as (assuming uniform spacing of control points):
This formula gives CatmullRom spline the following characteristics:
While a spline segment is defined using four control points, a spline may have any number of additional control points. This results in a continuous chain of segments, each defined by the two control points that form the endpoints of the segments, plus an additional control point on either side of the endpoints. Thus for a given segment with endpoints P_{n} and P_{n+1}, the segment would be calculated using [P_{n1}, P_{n}, P_{n+1}, P_{n+2}]. Because a segment requires control points to the outside of the segment endpoints, the segments at the extreme ends of the spline cannot be calculated. Thus, for a spline with control points 1 through N, the minimum segment that can be formulated is P_{1}<>P_{2}, and the maximum segment is P_{N}_{3}<>P_{N}_{2}. Thus, to define S segments, S+3 control points are required. Support of CatmullRom Splines in DirectXThe D3DX math libraries provide functions for calculating a point on a CatmullRom segment, using 2D, 3D, or 4D vectors. These functions are:
Each of these functions accepts four control points and a positional weight from 0.0 to 1.0, and returns an interpolated vector . The returned value will fall in the range of *pV2 (when s==0.0) to *pV3 (when s==1.0). Sample: Path Interpolation using CatmullRom Splines

Visitors Since 1/1/2000:
