i
i
i
i
i
i
i
i
590 13. Curves and Curved Surfaces
Figure 13.12. One method of computing the tangents is to use a combination of the
chords (left). The upper row at the right shows three curves with different tension
parameters (a). The left curve has a 1, which means high tension; the middle curve
has a 0, which is default tension; and the right curve has a ≈−1, which is low tension.
The bottom row of two curves at the right shows different bias parameters. The curve
on the left has a negative bias, and the right curve has a positive bias.
The top row at the right in Figure 13.12 shows different tension pa-
rameters. The default value is a = 0; higher values give sharper bends
(if a>1, there will be a loop at the joint), and negative values give less
taut curves near the joints. Second, a bias parameter, b, is introduced that
influences the direction of the tangent (and also, indirectly, the length of
the tangent). If we ignore the tension (a = 0) for a while, then the tangent
is computed as below:
m
i
=
1+b
2
(p
i
p
i1
)+
1 b
2
(p
i+1
p
i
). (13.20)
The default value is b = 0. A positive bias gives a bend that is more
directed toward the chord p
i
p
i1
, and a negative bias gives a bend that
is more directed toward the other chord: p
i+1
p
i
. Thisisshowninthe
bottom row on the right in Figure 13.12. Combining the tension and the
bias gives
m
i
=
(1 a)(1 + b)
2
(p
i
p
i1
)+
(1 a)(1 b)
2
(p
i+1
p
i
). (13.21)
The user can either set the tension and bias parameters or let them have
their default values, which gives a Catmull-Rom spline [160]. The tangents
at the first and the last points can also be computed with these formulae;
one of the chords is simply set to a length of zero.
Yet another parameter that controls the behavior at the joints can be
incorporated into the tangent equation [349, 680]. However, this requires
the introduction of two tangents at each joint, one incoming, denoted s
i
(for
source) and one outgoing, denoted d
i
(for destination). See Figure 13.13.
Note that the curve segment between p
i
and p
i+1
uses the tangents d
i
i
i
i
i
i
i
i
i
13.1. Parametric Cur ves 591
Figure 13.13. Incoming and outgoing tangents for Kochanek-Bartels curves. At each
control point p
i
, its time t
i
is also shown, where t
i
>t
i1
, for all i.
and s
i+1
. The tangents are computed as below, where c is the continuity
parameter:
s
i
=
1 c
2
(p
i
p
i1
)+
1+c
2
(p
i+1
p
i
),
d
i
=
1+c
2
(p
i
p
i1
)+
1 c
2
(p
i+1
p
i
).
(13.22)
Again, c = 0 is the default value, which makes s
i
= d
i
. Setting c = 1
gives s
i
= p
i
p
i1
,andd
i
= p
i+1
p
i
, producing a sharp corner at the
joint, which is only C
0
. Increasing the value of c makes s
i
and d
i
more
and more alike. For c =0,thens
i
= d
i
.Whenc = 1 is reached, we get
s
i
= p
i+1
p
i
,andd
i
= p
i
p
i1
. Thus, the continuity parameter c is
another way to give even more control to the user, and it makes it possible
to get sharp corners at the joints, if desired.
The combination of tension, bias, and continuity, where the default
parameter values are a = b = c =0,is
s
i
=
(1a)(1+b)(1c)
2
(p
i
p
i1
)+
(1a)(1b)(1+c)
2
(p
i+1
p
i
),
d
i
=
(1a)(1+b)(1+c)
2
(p
i
p
i1
)+
(1a)(1b)(1c)
2
(p
i+1
p
i
).
(13.23)
Both Equations 13.21 and 13.23 work only when all curve segments are
using the same time interval length. To account for different time length
of the curve segments, the tangents have to be adjusted, similar to what
was done in Section 13.1.3. The adjusted tangents, denoted s
i
and d
i
,are
shown below:
s
i
= s
i
i
Δ
i1
i
,
d
i
= d
i
i1
Δ
i1
i
,
(13.24)
i
i
i
i
i
i
i
i
592 13. Curves and Curved Surfaces
where Δ
i
= t
i+1
t
i
. This concludes the presentation of Kochanek-Bartels
splines, which gives the user three intuitive parameters, bias, tension, and
continuity, with which to design curves.
13.2 Parametric Curved Surfaces
A natural extension of parametric curves (Section 13.1) is parametric sur-
faces. An analogy is that a triangle or polygon is an extension of a line
segment, in which we go from one to two dimensions. Parametric surfaces
can be used to model objects with curved surfaces. A parametric surface is
defined by a small number of control points. Tessellation of a parametric
surface is the process of evaluating the surface representation at a num-
ber of positions, and connecting these to form triangles that approximate
the true surface. This is done because graphics hardware can efficiently
render triangles. At runtime, the surface can then be tessellated into as
many triangles as desired. Thus, parametric surfaces are perfect for mak-
ing a tradeoff between quality and speed; more triangles take more time
to render, but give better shading and silhouettes. Another advantage of
parametric surfaces is that the control points can be animated and then the
surface can be tessellated. This is in contrast to animating a large triangle
mesh directly, which can be more expensive.
This section starts by introducing ezier patches, which are curved
surfaces with rectangular domains. These are also called tensor-product
ezier surfaces.Thenezier triangles are presented, which have triangular
domains. An N-patch is a triangular B´ezier surface that can replace each
triangle in a triangle mesh. Using N-patches can improve the silhouette and
shading of a coarse mesh. They are presented in Section 13.2.3. Finally,
the topic of continuity is briefly treated in Section 13.2.4.
13.2.1 B
´
ezier Patches
The concept of ezier curves, introduced in Section 13.1.1, can be extended
from using one parameter to using two parameters, thus forming surfaces
instead of curves. Let us start with extending linear interpolation to bi-
linear interpolation. Now, instead of just using two points, we use four
points, called a, b, c,andd, as shown in Figure 13.14. Instead of us-
ing one parameter called t,wenowusetwoparameters(u, v). Using u to
linearly interpolate a & b and c & d gives e and f :
e =(1 u)a + ub,
f =(1 u)c + ud.
(13.25)
i
i
i
i
i
i
i
i
13.2. Parametric Curved Surfaces 593
Figure 13.14. Bilinear interpolation using four points.
Next, the linearly interpolated points, e and f, are linearly interpolated
in the other direction, using v. This yields bilinear interpolation:
p(u, v)=(1 v)e + vf
=(1 u)(1 v)a + u(1 v)b +(1 u)vc + uvd.
(13.26)
Equation 13.26 describes the simplest nonplanar parametric surface,
where different points on the surface are generated using different values
of (u, v). The domain, i.e., the set of valid values, is (u, v) [0, 1] × [0, 1],
which means that both u and v should belong to [0, 1]. When the domain
is rectangular, the resulting surface is often called a patch.
To extend a B´ezier curve from linear interpolation, more points were
added and the interpolation repeated. The same strategy can be used for
patches. Assume nine points, arranged in a 3 × 3 grid, are used. This
is shown in Figure 13.15, where the notation is shown as well. To form
Figure 13.15. Left: a biquadratic ezier surface, defined by nine control points, p
ij
.
Right: To generate a point on the ezier surface, four points p
1
ij
are first created
using bilinear interpolation from the nearest control points. Finally, the point surface
p(u, v)=p
2
00
is bilinearly interpolated from these created points.
i
i
i
i
i
i
i
i
594 13. Curves and Curved Surfaces
a biquadratic ezier patch from these points, we first need to bilinearly
interpolate four times to create four intermediate points, also shown in
Figure 13.15. Next, the final point on the surface is bilinearly interpolated
from the previously created points.
The repeated bilinear interpolation described above is the extension of
de Casteljau’s algorithm to patches. At this point we need to define some
notation. The degree of the surface is n. The control points are p
i,j
,where
i and j belong to [0 ...n]. Thus, (n +1)
2
control points are used for a
patch of degree n. Note that the control points should be superscripted
with a zero, i.e., p
0
i,j
, but this is often omitted, and sometimes we use the
subscript
ij
instead of
i,j
when there can be no confusion. The ezier patch
using de Casteljau’s algorithm is described in the equation that follows:
de Casteljau [patches]:
p
k
i,j
(u, v)=(1u)(1v)p
k1
i,j
+ u(1v)p
k1
i,j+1
+(1u)vp
k1
i+1,j
+ uvp
k1
i+1,j+1
,
k =1...n, i=0...n k, j =0...n k.
(13.27)
SimilartotheB´ezier curve, the point at (u, v)ontheB´ezier patch is
p
n
0,0
(u, v). The B´ezier patch can also be described in Bernstein form using
Bernstein polynomials, as shown in Equation 13.28:
Bernstein [patches]:
p(u, v)=
m
i=0
B
m
i
(u)
n
j=0
B
n
j
(v)p
i,j
=
m
i=0
n
j=0
B
m
i
(u)B
n
j
(v)p
i,j
,
=
m
i=0
n
j=0
m
i

n
j
u
i
(1 u)
mi
v
j
(1 v)
nj
p
i,j
.
(13.28)
Note that in Equation 13.28, there are two parameters, m and n,for
the degree of the surface. The compound” degree is sometimes denoted
m ×n.Mostoftenm = n, which simplifies the implementation a bit. The
consequence of, say, m>nis to first bilinearly interpolate n times, and
then linearly interpolate m n times. This is shown in Figure 13.16. An
interesting interpretation of Equation 13.28 is found by rewriting it as
p(u, v)=
m
i=0
B
m
i
(u)
n
j=0
B
n
j
(v)p
i,j
=
m
i=0
B
m
i
(u)q
i
(v).
(13.29)
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset