Game Development Reference
In-Depth Information
any particular axis is to abandon the attempt to completely orthogonalize
the entire matrix in one pass. We select some fraction k, and instead of
subtracting off all of the projection, we subtract off only k of it. We also
subtract the projection onto the original axis, not the adjusted one. In this
way, the order in which we perform the operations does not matter and we
have no dimensional bias. This algorithm is summarized by
− k r 1
r 2
r 2 r 2 r 2
− k r 1
r 3
r 3 r 3 r 3 ,
1
r
r 1
Nonbiased incremental
orthogonalization
algorithm
− k r 2 r 1
r 1
− k r 2 r 3
r 3
2
r
r 2
r 1 r 1
r 3 r 3 ,
r 2
r 2 r 2 r 2 .
One iteration of this algorithm results in a set of basis vectors that
are slightly “more orthogonal” than the original vectors, but possibly not
completely orthogonal. By repeating this procedure multiple times, we
can eventually converge on an orthogonal basis. Selecting an appropriately
small value for k (say, 1/4) and iterating a su cient number of times (say,
ten) gets us fairly close. Then, we can use the standard Gram-Schmidt
algorithm to guarantee a perfectly orthogonal basis.
r 3 − k r 3
r 1 r 1 r 1 − k r 3
r 1
3
r
6.4
4 × 4 Homogeneous Matrices
Up until now, we have used only 2D and 3D vectors. In this section, we
introduce 4D vectors and the so-called “homogeneous” coordinate. There
is nothing magical about 4D vectors and matrices (and no, the fourth co-
ordinate in this case isn't “time”). As we will see, 4D vectors and 4 × 4
matrices are nothing more than a notational convenience for what are sim-
ple 3D operations.
This section introduces 4D homogeneous space and 4×4 transformation
matrices and their application to a ne 3D geometry. Section 6.4.1 discusses
the nature of 4D homogeneous space and how it is related to physical 3D
space. Section 6.4.2 explains how 4×4 transformation matrices can be used
to express translations. Section 6.4.3 explains how 4 × 4 transformation
matrices can be used to express a ne transformations.
6.4.1 4D Homogeneous Space
As was mentioned in Section 2.1, 4D vectors have four components, with
the first three components being the standard x, y, and z components.
The fourth component in a 4D vector is w, sometimes referred to as the
homogeneous coordinate.
 
Search WWH ::




Custom Search