i
i
i
i
i
i
i
i
13.2. Parametric Curved Surfaces 595
Figure 13.16. Different degrees in different directions.
Here, q
i
(v)=
n
j=0
B
n
j
(v)p
i,j
for i =0...m. As can be seen in the
bottom row in Equation 13.29, this is just a ezier curve when we fix a
v-value. Assuming v =0.35, the points q
i
(0.35) can be computed from
aB´ezier curve, and then Equation 13.29 describes a B´ezier curve on the
ezier surface, for v =0.35.
Next, some useful properties of B´ezier patches will be presented. By
setting (u, v)=(0, 0), (u, v)=(0, 1), (u, v)=(1, 0), and (u, v)=(1, 1)
in Equation 13.28, it is simple to prove that a B´ezier patch interpolates,
that is, goes through, the corner control points, p
0,0
, p
0,n
, p
n,0
,andp
n,n
.
Also, each boundary of the patch is described by a ezier curve of degree
n formed by the control points on the boundary. Therefore, the tangents
at the corner control points are defined by these boundary ezier curves.
Each corner control point has two tangents, one in each of the u and v
directions. As was the case for B´ezier curves, the patch also lies within the
convex hull of its control points, and
m
i=0
n
j=0
B
m
i
(u)B
n
j
(v)=1
for (u, v) [0, 1] ×[0, 1]. Finally, rotating the control points and then gen-
erating points on the patch is the same mathematically as (though usually
faster than) generating points on the patch and then rotating these. Par-
tially differentiating Equation 13.28 gives [332] the equations below:
Derivatives [patches]:
p(u, v)
∂u
= m
n
j=0
m1
i=0
B
m1
i
(u)B
n
j
(v)[p
i+1,j
p
i,j
],
p(u, v)
∂v
= n
m
i=0
n1
j=0
B
m
i
(u)B
n1
j
(v)[p
i,j+1
p
i,j
].
(13.30)
i
i
i
i
i
i
i
i
596 13. Curves and Curved Surfaces
Figure 13.17. Left: control mesh of a 4 × 4degreeB´ezier patch. Middle: the actual
quadrilaterals that were generated on the surface. Right: shaded ezier patch.
Figure 13.18. This set of images shows what happens to a ezier patch when one vertex
is moved. Most of the change is near the moved control point.
i
i
i
i
i
i
i
i
13.2. Parametric Curved Surfaces 597
As can be seen, the degree of the patch is reduced by one in the direction
that is differentiated. The unnormalized normal vector is then formed as
n(u, v)=
p(u, v)
∂u
×
p(u, v)
∂v
. (13.31)
In Figure 13.17, the control mesh together with the actual ezier patch
is shown. The effect of moving a control point is shown in Figure 13.18.
Rational B
´
ezier Patches
Just as the B´ezier curve could be extended into a rational ezier curve
(Section 13.1.1), and thus introduce more degrees of freedom, so can the
ezier patch be extended into a rational B´ezier patch:
p(u, v)=
m
i=0
n
j=0
w
i,j
B
m
i
(u)B
n
j
(v)p
i,j
m
i=0
n
j=0
w
i,j
B
m
i
(u)B
n
j
(v)
. (13.32)
Consult Farin’s book [332] and Hochek and Lasser’s book [569] for in-
formation about this type of patch. Similarly, the rational B´ezier triangle
is an extension of the B´ezier triangle, treated next.
13.2.2 B
´
ezier Triangles
Even though the triangle often is considered a simpler geometric primitive
than the rectangle, this is not the case when it comes to ezier surfaces:
ezier triangles are not as straightforward as ezier patches. This type
of patch is worth presenting as it is used in forming N-patches, which are
supported directly on some GPUs. N-patches are discussed in the section
after this.
The control points are located in a triangular grid, as shown in Fig-
ure 13.19. The degree of the ezier triangle is n, and this implies that
there are n + 1 control points per side. These control points are denoted
Figure 13.19. The control points of a B´ezier triangle with degree three (cubic).
i
i
i
i
i
i
i
i
598 13. Curves and Curved Surfaces
p
0
i,j,k
and sometimes abbreviated to p
ijk
.Notethati + j + k = n,and
i, j, k 0 for all control points. Thus, the total number of control points is
n+1
x=1
x =
(n +1)(n +2)
2
.
It should come as no surprise that ezier triangles also are based on re-
peated interpolation. However, due to the triangular shape of the domain,
barycentric coordinates (see Section 16.8) must be used for the interpola-
tion. Recall that a point within a triangle Δp
0
p
1
p
2
, can be described as
p(u, v)=p
0
+ u(p
1
p
0
)+v(p
2
p
0
)=(1u v)p
0
+ up
1
+ vp
2
,where
(u, v) are the barycentric coordinates. For points inside the triangle the
following must hold: u 0, v 0, and 1 (u + v) 0 u + v 1. Based
on this, the de Casteljau algorithm for B´ezier triangles is
de Casteljau [triangles]:
p
l
i,j,k
(u, v)=up
l1
i+1,j,k
+ vp
l1
i,j+1,k
+(1 u v)p
l1
i,j,k+1
,
l =1...n, i+ j + k = n l.
(13.33)
The final point on the ezier triangle at (u, v)isp
n
000
(u, v). The ezier
triangle in Bernstein form is
Bernstein [triangles]:
p(u, v)=
i+j+k=n
B
n
ijk
(u, v)p
ijk
.
(13.34)
The Bernstein polynomials now depend on both u and v, and are there-
fore computed differently, as shown below:
B
n
ijk
(u, v)=
n!
i!j!k!
u
i
v
j
(1 u v)
k
,i+ j + k = n. (13.35)
The partial derivatives are [332]:
Derivatives [triangles]:
p(u, v)
∂u
=
i+j+k=n1
B
n1
ijk
(u, v)p
i+1,j,k
,
p(u, v)
∂v
=
i+j+k=n1
B
n1
ijk
(u, v)p
i,j+1,k
.
(13.36)
Some unsurprising properties of B´ezier triangles are that they interpo-
late (pass through) the three corner control points, and that each boundary
i
i
i
i
i
i
i
i
13.2. Parametric Curved Surfaces 599
Figure 13.20. Top: wireframe of a B´ezier triangle. Bottom: shaded surface together with
control points.
is a ezier curve described by the control points on that boundary. Also,
the surfaces lies in the convex hull of the control points. A B´ezier triangle
is shown in Figure 13.20.
Next, we will discuss a direct application of B´ezier triangles.
13.2.3 N-Patches
Given an input triangle mesh with normals at each vertex, the goal of the
N-patches scheme by Vlachos et al. [1304] is to construct a better looking
surface on a triangle basis. The term “N-patches” is short for “normal
patches,” and these patches are also called PN triangles.Thisscheme
attempts to improve the triangle mesh’s shading and silhouette by creating
a curved surface to replace each triangle. Hardware is able to make each
surface on the fly because the tessellation is generated from each triangle’s
points and normals, with no neighbor information needed. API changes are
minimal; all that is needed is a flag telling whether to generate N-patches,
and a level of tessellation. See Figure 13.21 for an example. The algorithm
presented here builds upon work by van Overveld and Wyvill [1298].
Assume we have a triangle with vertices p
300
, p
030
,andp
003
with
normals n
200
, n
020
,andn
002
. The basic idea is to use this information
..................Content has been hidden....................

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