Game Development Reference
In-Depth Information
Vectors in 3-Space
Geometrically, we represent a vector as a directed line segment, as
shown in Figure 1. The two properties of vectors are their length (also
known as the magnitude and the norm) and the direction in which they
point. Thus, vectors are useful for modeling physical quantities that
possess both a magnitude and direction. For example, in Chapter 14 we
implement a particle system. We use vectors to model the velocity and
acceleration of our particles. Other times in 3D computer graphics we
use vectors to model directions only. For instance, we often want to
know the direction in which a ray of light is traveling, the direction a
polygon is facing, or the direction the camera is looking in the 3D
world. Vectors provide a convenient mechanism for describing such
directions in 3-space.
Since location is not a property of vectors, two vectors that have
the same length and point in the same direction are considered equal,
even if they are in different locations. Observe that two such vectors
are parallel to each other. For example, in Figure 1, the vectors u and v
are equal.
Figure 1: Free vectors defined inde-
pendently of a particular coordinate
system
Figure 1 shows that vectors can be discussed independently of a partic-
ular coordinate system because the vector itself (directed line segment)
contains the meaningful information—the direction and magnitude.
Introducing a coordinate system does not give the vector meaning;
rather the vector, which inherently contains its meaning, is simply
described relative to that particular system. And as we change coordi-
nate systems we are just describing the same vector relative to differ-
ent systems.
Search WWH ::




Custom Search