Graphics Reference
In-Depth Information
P i
R i
Q i
P i 1
P i 1
FIGURE B.40
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 perpendicular to the angle
bisector for computing the internal tangent.
to independently determine the length of the tangent vector for each segment it is associated with. Thus,
a point P i has an ending tangent vector associated with it for the segment from P i -1 to P i as well as a
beginning tangent vector associated with it for the segment P i to P i þ 1 . These tangents have the same
direction but different lengths. This relaxes the C
1
continuity instead. For example, an initial tangent vector at an interior point is determined as the vector
from P i -1 to P i þ 1 . The ending tangent vector for the segment P i -1 to P i is computed by scaling this
initial tangent vector by the ratio of the distance between the points P i and P i -1 to the distance between
points P i -1 and P i þ 1 . Referring to the segment between P i -1 and P i as P i -1 ( u ) results in Equation B.78 .
A similar calculation for the beginning tangent vector of the segment between P i and P i þ 1 results in
Equation B.79 . These tangents can be seen in Figure B.41 . The computational cost of this approach is
only a little more than the standard Catmull-Rom spline and seems to give more intuitive results.
1 continuity of the Catmull-Rom spline and uses G
Þ¼ jP i P i 1 j
jP 1 P i 1 j
0
P
ð
1
:
0
ð
P 1 P i 1
Þ
(B.78)
i 1
Þ¼ jP 1 P i j
jP 1 P i 1 j
0
P
i ð
0
:
0
ð
P 1 P i 1
Þ
(B.79)
P i (0.0)
P i
P
i 1 (1.0)
P i ( u )
P i 1 ( u )
P i 1
P i 1
FIGURE B.41
Interior tangents based on relative segment lengths.
 
Search WWH ::




Custom Search