Graphics Reference
In-Depth Information
differentiable. This is fine in some simple modeling applications, but you would
not want to use a Catmull-Rom spline curve as a path for a dollied camera, for
example: The resultant camera motion would seem very jerky to the viewer.
We can generalize and say, “Given
P
0
,
3.5
...
,
P
n
and a sequence of parameter values
2.5
t
0
<...<
n
.” These parameter
values
t
i
are called
knots,
and the sequence of knots is denoted by the letter
T
=
t
0
,
t
1
,
t
n
, find a curve
γ
such that
γ
(
t
i
)=
P
i
for
i
=
0,
...
1.5
,
t
n
. Figure 22.9 shows a spline with knots at
t
=
0, 1, 3, 4.3, 3.8, 5.5 and
control points drawn as red circles; the large blue dots are the fictitious control
points. The 50 green dots are equispaced from 1 to 5.5 to show the velocity of the
curve.
...
0.5
1.5
2.5
3.5
4.5
5.5
Figure
22.9:
A
generalized
; the constant
inter-knot spacing leads to the name
uniform
for this kind of spline. In this sec-
tion, we're describing the generalization to a
nonuniform Catmull-Rom spline.
To solve the general problem of finding the nonuniform Catmull-Rom spline
for a given sequence of knots and control points, we once again add a fictitious
pre-start point
P
−
1
=
P
0
−
The basic Catmull-Rom spline has its knots at
t
=
0, 1, 2,
...
Catmull-Rom spline.
(
P
1
−
P
0
)
, but we also add a pre-start knot,
t
−
1
=
t
0
−
t
0
)
, and corresponding post-end point and knot. The
i
th segment of the
curve is controlled by points
P
i
−
1
,
P
i
,
P
i
+
1
,
P
i
+
2
and is defined for
t
(
t
1
−
[
t
i
,
t
i
+
1
]
,
but it is influenced by
t
i
−
1
and
t
i
+
2
as well. The four blending functions for this
i
th segment,
t
∈
→
p
i
,1
(
T
,
t
)
,
t
→
p
i
,2
(
T
,
t
)
,
t
→
p
i
,3
(
T
,
t
)
, and
t
→
p
i
,4
(
T
,
t
)
, which
are used to blend
P
i
−
1
,
P
i
,
P
i
+
1
, and
P
i
+
2
,aregivenby
t
i
+
1
)
2
p
i
,1
(
t
)=
−
(
t
−
t
i
)(
t
−
(22.11)
(
t
i
+
1
−
t
i
−
1
)(
t
i
−
t
i
+
1
)
2
p
i
,2
(
t
)=
(
t
−
t
i
+
1
)
2
(
t
i
−
t
i
+
1
+
2
(
t
i
−
t
))
(
t
−
t
i
+
1
)(
t
i
−
t
)
2
)
−
(22.12)
(
t
i
−
t
i
+
1
)
3
(
t
i
+
2
−
t
i
)(
t
i
−
t
i
+
1
)
2
t
i
)
2
(
t
i
+
1
−
t
)
2
)
p
i
,3
(
t
)=
(
t
−
t
i
+
2
(
t
i
+
1
−
t
))
(
t
−
t
i
)(
t
i
+
1
−
+
(22.13)
(
t
i
+
1
−
t
i
)
3
(
t
i
+
1
−
t
i
−
1
)(
t
i
+
1
−
t
i
)
2
and
t
i
)
2
(
t
−
t
i
+
1
)(
t
−
p
i
,4
(
t
)=
t
i
)
2
.
(22.14)
(
t
i
+
2
−
t
i
)(
t
i
+
1
−
For the special case
t
i
=
i
, these agree with the Catmull-Rom basis functions given
in the previous section.
To make this concrete, suppose we specify a nonuniform Catmull-Rom spline
in the plane with the data
i
t
i
P
i
0
1
(1, 3)
1
1.2
(2, 3)
2
1.7
(3, 4)
3
2.5
(3, 6)
and we wish to evaluate the spline curve at many
t
-values so as to make a polyline
that closely approximates it.