Graphics Reference
In-Depth Information
B.5.7
Four-point form
Fitting a cubic segment to four points (
P
0
,
P
1
,
P
2
,
P
3
) assigned to user-specified parametric values (
u
0
,
u
1
,
u
2
,
u
3
) can be accomplished by setting up the linear system of equations for the points (
Eq. B.80
)
and
solving for the unknown coefficient matrix. In the case of parametric values of 0, 1/3, 2/3, and 1, the
matrix is given by
Equation B.81
.
However, with this form it is difficult to join segments with
C
1
continuity.
2
4
3
5
2
4
3
5
m
0
;
0
m
0
;
1
m
0
;
2
m
0
;
3
P
0
P
1
P
2
P
3
m
1
;
0
m
1
;
1
m
1
;
2
m
1
;
3
3
2
PðuÞ¼½u
u
u
1
m
2
;
0
m
2
;
1
m
2
;
2
m
2
;
3
m
3
;
0
m
3
;
1
m
3
;
2
m
3
;
3
2
4
3
5
(B.80)
2
4
3
5
¼
2
4
3
5
2
4
3
5
3
0
2
0
u
u
u
0
1
m
0
;
0
m
0
;
1
m
0
;
2
m
0
;
3
P
0
P
1
P
2
P
3
P
0
P
1
P
2
P
3
3
1
2
1
u
u
u
1
1
m
1
;
0
m
1
;
1
m
1
;
2
m
1
;
3
m
2
;
0
m
2
;
1
m
2
;
2
m
2
;
3
u
2
u
2
u
2
1
m
3
;
0
m
3
;
1
m
3
;
2
m
3
;
3
3
3
u
u
u
3
1
2
4
3
5
97
27
1
2
18
45
36
9
M ¼
(B.81)
11
18
92
2
0
0
0
B.5.8
Blended parabolas
Blending overlapping parabolas to define a cubic segment is another approach to interpolating a curve
through a set of points. In addition, the end conditions are handled by parabolic segments, which is
consistent with how the interior segments are defined. Blending parabolas results in a formulation that
is very similar to Catmull-Rom in that each segment is defined by four points, it is an interpolating
curve, and local control is provided. Under the assumptions used here for Catmull-Rom and the blended
parabolas, the interpolating matrices are identical.
For each overlapping triple of points, a parabolic curve is defined by the three points. A cubic curve
segment is created by linearly interpolating between the two overlapping parabolic segments. More
specifically, take the first three points,
P
0
,
P
1
, and
P
2
, and fit a parabola,
P
(
u
), through them using
the following constraints:
P
(0.0)
¼ P
0
,
P
(0.5)
¼ P
1
,
P
(1.0)
¼ P
2
. Take the next group of three points,
P
1
,
P
2
,
P
3
, which partially overlap the first set of three points, and fit a parabola,
R
(
u
), through them
using similar constraints:
R
(0.0)
¼ P
3
. Between points
P
1
and
P
2
the two
parabolas overlap. Reparameterize this region into the range [0.0, 1.0] and linearly blend the two par-
abolic segments (
Figure B.42
)
. The result can be put in matrix form for a cubic curve using the four
points as the geometric information together with the coefficient matrix shown in
Equation B.82
.
To
interpolate a list of points, this matrix is used by varying U as in previous examples.
¼ P
1
,
R
(0.5)
¼ P
2
,
R
(1.0)
2
4
3
5
13
31
1
2
2
54
1
M ¼
(B.82)
1010
0200
Search WWH ::
Custom Search