Graphics Reference
In-Depth Information
(
P
2
P
1
)
P
1
P
1
P
2
P
0
P
0
FIGURE B.37
Automatically forming the initial tangent of a Catmull-Rom spline.
FIGURE B.38
Catmull-Rom spline with end conditions using
Equation B.77
.
P
i
R
i
Q
i
P
i
1
P
i
1
FIGURE B.39
Three curve segments, (
P
i-1
,
P
i
,P
i þ1
), (
P
i-1
,
Q
i
,P
i þ1
), and (
P
i-1
,
R
i
,P
i þ1
), using the standard Catmull-Rom form
for computing the internal tangent.
An advantage of Catmull-Rom is that the calculation to compute the internal tangent vectors is
extremely simple and fast. However, for each segment the tangent computation is a one-time-only cost.
It is then used repeatedly in the computation for each new point in that segment. Therefore, it often
makes sense to spend a little more time computing more appropriate internal tangent vectors to obtain
a better set of points along the segment. One alternative is to use a vector perpendicular to the plane that
bisects the angle made by
P
i
-1
P
i
and
P
i þ
1
P
i
(
Figure B.40
). This can be computed easily by adding
the normalized vector from
P
i
-1
to
P
i
with the normalized vector from
P
i
to
P
i þ
1
.
Another modification, which can be used with the original Catmull-Rom tangent computation or
with the previously mentioned bisector technique, is to use the relative position of the internal point (
P
i
)
Search WWH ::
Custom Search