Graphics Reference
In-Depth Information
n
γ
( t )=
P i b 3 ( t
i ) , where
(22.17)
i = 0
1
6 t 3
0
t
1
1
6 (
1 ) 3 + 3 ( t
1 ) 2 + 3 ( t
3 ( t
1 )+ 1 ) 1
t
2
1
2 ) 3
2 ) 2 + 4 )
b 3 ( t )=
6 ( 3 ( t
6 ( t
2
t
3
(22.18)
1
3 ) 3 + 3 ( t
3 ) 2
6 (
( t
3 ( t
3 )+ 1 )
3
t
4
0
otherwise.
The domain of the curve
γ
is 0
t
n
2. Because of the structure of the
function b 3 , it turns out that for j
t
j + 1, the point
γ
( t ) lies in the convex hull
...
of the four points P j ,
, P j + 3 .This convex hull property is useful in computing
the intersection of a ray with a B-spline: If the ray misses the convex hull of
four sequential control points, it also must miss the corresponding segment of the
B-spline curve. If the ray hits the convex hull, then further computation is needed.
The web material for this chapter gives details.
Just like the Bézier and Hermite curves, a segment of a B-spline can be
expressed in a matrix form, which can make evaluation more efficient. Recall
that the form for the Bézier and Hermite curves was
γ
( t )= GMT ( t ) ,
(22.19)
where T ( t ) is the vector 1 t 2 t 3 T of powers of t . Because a B-spline curve
is made of many segments, defined for 0
t
1, 1
t
2, etc., we'll end
up using T ( t
j ) for the j th segment, that is, a vector of powers of the fractional
part of t .
For the j th segment, defined for j
t
j + 1, and influenced by control points
P j ,
...
P j + 3 , we define a geometry matrix
G B = P j ; P j + 1 ; P j + 2 ; P j + 3
(22.20)
which is 2
4 for curves in space, and contains
the coordinates of the control points as columns of the matrix. We multiply this
by the B-spline basis matrix, M Bs :
×
4 for curves in the plane, or 3
×
0001
133
1
6
3
.
(22.21)
40
63
1
33
1
The uniform B-spline curve is then
γ
( t )= G B M Bs t ( t
j ) ,
(22.22)
where j =
j is the fractional part of t .
Although B-splines don't pass through their control points, their extra degree
of continuity makes them attractive in many applications. The tradeoff between
controllability (does the curve interpolate its control points?) and continuity (how
smooth is it?) is one that must be managed on a case-by-case basis in applications.
t
so that t
 
Search WWH ::




Custom Search