Game Development Reference
In-Depth Information
Summary
Vectors are used to model physical quantities that possess a magni-
tude and direction mathematically. Geometrically, we represent a
vector with a directed line segment. A vector is in standard position
when it is translated parallel to itself so that its tail coincides with
the origin of the coordinate system. A vector in standard position
can be described algebraically by specifying the coordinates of its
head.
We can use 4
4 matrices to represent transformations and 1
4
homogeneous vectors to describe points and vectors. The vector-
matrix product of a 1
4 row vector and a 4
4 transformation
matrix results in a new transformed 1
4 row vector. Several trans-
formation matrices can be combined into one transformation matrix
through matrix-matrix multiplication.
We use 4D homogeneous vectors to represent both vectors and
points. We specify 0 for the
w
component to denote a vector and 1
for the
w
1, then we
have a vector (
x, y, z, w
) in homogeneous space that can be
mapped back to 3-space by dividing each component by
w
:
w
component to denote a point. If
w
0 and
xy zw xy z xy z
wwww www www
,
,
,
,
,
, 1 ,
,
Planes divide 3D space into two parts: a positive half-space, which
is the space in front of the plane, and a negative half-space, which is
the space behind the plane. Planes are useful for testing the locality
of points relative to them (in other words, what half-space a point
exists in relative to a particular plane).
Rays are described parametrically with an origin and direction vec-
tor. Rays are useful for modeling various physical quantities, such
as light rays and projectiles that approximately follow a linear path
such as bullets and rockets.
Search WWH ::
Custom Search