Catmull–Rom spline
Catmull–Rom spline is a special case of a cardinal spline. This assumes uniform parameter spacing.
For tangents chosen to be
in the definition formula of cubic Hermite spline:
the following formula for the Catmull–Rom spline is obtained:
The curve is named after Edwin Catmull and Raphael Rom. The principal advantage of this technique is that the points along the original set of points also make up the control points for the spline curve.
Two additional points are required on either end of the curve. The uniform Catmull–Rom implementation can produce loops and self-intersections. The chordal and centripetal Catmull–Rom implementations solve this problem, but use a slightly different calculation. In computer graphics, Catmull–Rom splines are a common way to create smooth movement between key moments. For example, they’re often used to turn a series of camera keyframes into a fluid camera path.
Definition (by Catmull and Rom)
Referenced paper is for a class of splines passing through their defining points.Graphs and experimental results for the following blending functions are shown, with "case 3" being a Catmull–Rom spline curve.
| Interval Width | Differentiability | Type | Degree of Polynomial for Cardinal Function | |
| case 1 | 3 | 1 | B-SPLINE | |
| case 2 | 4 | 2 | BEZIER | |
| case 3 | 4 | 1 | B-SPLINE | 1 |
| case 4 | 6 | 2 | B-SPLINE | 2 |
The model of the spline is:
where are defining points, are shifted blending functions into interval.
Below are, from left, an example of blending functions, its shifted, and a curve.
800px
The blending functions are following cardinal functions:
Linear Lagrange interpolation is used, so, resulting in:
where is a blending function obtained by shifting the basis functions of a quadratic uniform B-spline.
Below are, from the left, blending functions of a quadratic uniform B-spline and the basis functions before shifting.
480px
The graphs of each term in are as follows:
300px
Applying this to :
are obtained. Shifting these to the interval gives, and arrange them into matrix form gives:
which coincides with the definition by a cubic Hermite spline.
Properties
Comparison with B-spline
A Catmull–Rom spline curve is interpolation that passes through its defining points, whereas a B-spline curve is approximation that do not pass through its control points.Below are, from left, an example of blending functions, basis functions before shifting, and a curve of cubic uniform B-spline.
800px
Continuity
A Catmull–Rom spline curve is C1 continuous by its definition and the following, but not C2 continuous:Self-intersection
If the difference in the intervals between the defining points is large in the middle of a curve, cusps or self-intersections may occur.Below is an example of a self-intersection:
200px
Converting to Bézier curve
[file:CatmullRomSpline example3.png|thumb|Example of converted Bézier curve (red: control points of Bézier curve)]Since the matrix form of a cubic Bézier curve is:
the control points of a cubic Bézier curve equivalent to the Catmull–Rom spline curve are:
Extension to Surfaces ([bicubic interpolation])
By taking the cartesian cross product of two Catmull-Rom splines, one can get a bivariate surface that interpolates a grid of points.。It is a bicubic patch expressed by the following formula:
where
The patch interpolates the middle four points. Adjoinging patches have continuity of the first derivative.
Expansion of tension parameter
[file:CatmullRomSpline_example4.gif|thumb|An example of visual effect of the tension parameter on interpolated motion between keyframes (white circle: keyframe, blue:, green:, red: )]In some cases, Catmull–Rom spline is:
where the coefficient of the tangent vector is replaced with.。
In this case, the definition formula is as follows:
The relationship between and the tension parameter of Kochanek–Bartels spline is as follows:
[file:CatmullRomSpline example6.png|thumb|Example of converted Bézier curve ()]
And the control points of the equivalent cubic Bézier curve are as follows: