Game Development Reference
In-Depth Information
that particular usage of the term in the proper context.) It's often helpful
to establish a local coordinate space on the surface of an object where one
axis (we'll use +z) is parallel to the surface normal, and the other axes
point in the direction of increasing u and v in the texture. These latter two
basis vectors are sometimes called the tangent and binormal. Motion in 3D
space in the direction of the tangent basis vector corresponds to horizontal
motion in the 2D image space of the texture, while a displacement in 3D
space in the direction of the binormal would correspond to vertical image-
space displacement. The key fact is that the flat 2D texture often must be
warped to wrap it around an irregular surface, and the basis vectors are
not guaranteed to be perpendicular. 8
Figure 3.11 shows a situation in which the
basis vectors p and q have the same length,
but are not perpendicular. Although we've
shown only two example vectors, a and b ,
the set of vectors that can be described as
a linear combination x p + y q fill an infinite
plane, and for any vector in this plane, the
coordinates [x,y] are uniquely determined.
The set of vectors that can be expressed
as a linear combination of the basis vectors
is called the span of the basis. In the ex-
ample in Figure 3.11, the span is an infinite
2D plane. This might seem at first like it's
the only possible scenario, but let's examine
some more interesting situations. First of all,
note that we said that the vectors fill “an” infinite plane, not “the” plane.
Just because we have two coordinates and basis vectors does not mean
that p and q must be 2D vectors! They could be 3D vectors, in which
case their span will be some arbitrary plane within 3D space, as depicted
in Figure 3.12.
Figure 3.12 illustrates several key points. Note that we have chosen
a and b to have the same coordinates from Figure 3.11, at least relative
to the basis vectors p and q . Second, when working within the space of
p and q , our example vectors a and b are 2D vectors; they have only
two coordinates, x and y. We might also be interested in their 3D “world”
coordinates; these are obtained simply by expanding the linear combination
x p + y q ; the result of this expression is a 3D vector.
Figure 3.11
Basis vectors don't have to be
perpendicular.
8 Note that it is a common optimization to ignore this possibility and assume that
they are perpendicular, even when they aren't. This assumption introduces some error
in some cases, but it permits a reduction in storage and bandwidth, and the error is
usually not noticeable in practice. We'll discuss this in greater detail in Section 10.9.
Search WWH ::




Custom Search