Game Development Reference
In-Depth Information
games using these libraries must use the default coordinate systems because it's
relatively straightforward to configure both to use a different coordinate system.
Sometimes the x-, y-, and z-axes are instead referred to as the , , and basis
vectors . The basis vectors are what formally define the coordinate system. As we
will discuss in Chapter 4 , the generic way to change from any arbitrary coordinate
system to another is by using a change of basis matrix . But before we can con-
struct one of these, we first must cover matrices.
Matrices
A matrix is a grid of real numbers, with m rows and n columns, and is typically
expressed by a capital letter. For games, 3×3 and 4×4 matrices are the most com-
mon. A 3×3 matrix could be written as such, where the letters a through i simply
represent numbers within the matrix:
Another method for matrix declaration is to use subscript coordinates to refer to
the specific elements. The preceding matrix could be rewritten as follows:
In 3D games, matrices are used to transform , or change, vectors and positions.
We will cover these types of transformations in Chapter 4 . For now, let's cover the
basic matrix operations.
Addition/Subtraction
Two matrices can be added or subtracted if they both have the same dimensions.
To add them, simply add the corresponding components to each other.
Search WWH ::




Custom Search