Graphics Reference
In-Depth Information
1to0to1, u ranges from 0 to 2 to 1. At u = 2 ,
the dark color we find in the texture map creates a dark spot in the image. To be
clear: This “rendering” algorithm involves no lighting or reflection or anything
like that. It's simply following the rule that we can draw the contours of an object
to make a reasonably effective picture of it. An actual implementation of a slightly
fancier version of this algorithm is given in Section 33.8.
As the dot product ranges from
20.3 Building Tangent Vectors from
a Parameterization
We'll now describe how to find a frame (i.e., a basis) for the tangent space at each
point of a parameterized smooth surface, and then, working by analogy, describe
a similar construction for a mesh.
The sphere, which we'll use as our smooth example, is often parameterized by
P (
θ
,
φ
) = (cos
θ
cos
φ
, sin
φ
, sin
θ
cos
φ
) ,
(20.6)
2
to 2 .
where
θ
ranges from 0 to 2
π
, and
φ
ranges from
If we hold
θ
constant in P (
θ
,
φ
) and vary
φ
, we get a line of longitude; simi-
larly, if we hold
, we get a line of latitude. If we compute the
tangent vectors to these two curves, we get
φ
constant and vary
θ
)=
φ T
P
∂φ
(
θ
,
φ
cos
θ
sin
φ
cos
φ −
sin
θ
sin
and
(20.7)
)=
φ T .
P
∂θ
(
θ
,
φ
sin
θ
cos
φ
0 cos
θ
cos
(20.8)
Figure 20.6: The sphere, with
vertical lines of constant θ and
horizontal lines of constant φ
drawn in red and blue, respec-
tively,
These vectors, drawn at the location P (
) , are tangent to the sphere at that point,
and they happen to be perpendicular as well (see Figure 20.6). Except at the north
and south poles (where cos(
θ
,
φ
)= 0), the vectors are nonzero, so the two of them
constitute a frame at almost every point. In general, it's topologically impossible
to find a smoothly varying frame at every point of an arbitrary surface, so our
situation, with a frame at almost every point, is the best we can hope for.
φ
and
tangent
vectors
to
those curves at a few points.
In general, if we have any surface parameterized by a function like P of two
variables—say, u and v —then P
u ( u , v ) and P
v ( u , v ) are a pair of vectors at the
point ( u , v ) that form a basis for the tangent plane there, except in two circum-
stances: One of the vectors may be zero, or the two vectors may be parallel. In
both situations, the parameterization is degenerate in some way, and for “nice”
surface parameterizations this should happen only at isolated points. To get an
even nicer framing, you can normalize the first vector and compute its cross prod-
uct with the normal vector to get the second; the result will be an orthonormal
frame at every place where the first vector is nonzero.
We can now proceed analogously on a mesh for which each vertex has xyz -
coordinates and uv -texture coordinates assigned. We'll do so one face at a time.
The assignment of ( u , v ) coordinates to each vertex defines an affine (linear-plus-
translation) map from the xyz -plane of the triangular face to the uv -plane (or vice
versa). We'd like to know what the curve of constant u or constant v looks like,
 
 
 
Search WWH ::




Custom Search