Game Development Reference
In-Depth Information
Now let's be even more general. In order to do so, it will help greatly to
remove translation from our consideration. One way to do this is to discard
“points” and think exclusively of vectors, which, as geometric entities, do
not have a position (only magnitude and direction); thus translation does
not really have a meaning for them. Alternatively, we can simply restrict
the object space origin to be the same as the world-space origin.
Remember that in Section 2.3.1 we discussed how any vector may be
decomposed geometrically into a sequence of axially-aligned displacements.
Thus, an arbitrary vector v can be written in “expanded” form as
Expressing a 3D vector
as a linear combination
of basis vectors
v = x p + y q + z r .
(3.2)
Here, p , q , and r are basis vectors for 3D space. The vector v could have
any possible magnitude and direction, and we could uniquely determine
the coordinates x, y, z (unless p , q , and r are chosen poorly; we discuss
this key point in just a moment). Equation (3.2) expresses v as a linear
combination of the basis vectors.
Here is a common, but a bit incomplete, way to think about basis vec-
tors: most of the time, p = [1,0,0], q = [0,1,0], and r = [0,0,1]; in other
unusual circumstances, p , q , and r have different coordinates. This is not
quite right. When thinking about p , q , and r , we must distinguish between
the vectors as geometric entities (earlier, p and q were the physical direc-
tions of “left” and “up”) and the particular coordinates used to describe
those vectors. The former is inherently immutable; the latter depends on
the choice of basis. Plenty of topics emphasize this by defining all vectors
in terms of the “world basis vectors,” which are often denoted i , j , and k
and are interpreted as elemental geometric entities that cannot be further
decomposed. They do not have “coordinates,” although certain axioms are
taken to be true, such as i
j = k . In this framework, a coordinate triple
[x,y,z] is a mathematical entity, which does not have a geometric meaning
until we take the linear combination x i + y j + z k . Now, in response to the
assertion i = [1,0,0], we might argue that since i is a geometric entity, it
cannot be compared against a mathematical object, in the same way that
the equation “kilometer = 3.2” is nonsense. Because the letters i , j , and k
carry this weighty elemental connotation, we instead use the less presump-
tuous symbols p , q , and r , and whenever we use these symbols to name
our basis vectors, the message is: “we're using these as our basis vectors
for now, but we might know how to express p , q , r relative to some other
basis, so they aren't necessarily the 'root' basis.”
The coordinates of p , q , and r are always equal to [1,0,0], [0,1,0],
and [0,0,1], respectively, when expressed using the coordinate space for
which they are the basis, but relative to some other basis they will have
arbitrary coordinates. When we say that we are using the standard basis,
×
Search WWH ::




Custom Search