Game Development Reference
In-Depth Information
Thismatrixwillhavenoeffectonavectorbecausethehomogenousrepresentation
of a vector has a w-component of 0. This means that the fourth row of the transla-
tion matrix would be cancelled out when the vector and matrix are multiplied. But
for points, the w-component is typically 1, which means the translation compon-
ents will be added in.
To invert a translation matrix, negate each of the translation components.
Rotation
A rotation matrix enables you to rotate a vector or position about a coordinate
axis. There are three different rotation matrices, one for each Cartesian coordinate
axis. So a rotation about the x-axis has a different matrix than a rotation about the
y-axis. In all cases, the angle θ is passed into the matrix.
These rotations are known as Euler rotations , named after the Swiss mathem-
atician.
As an example, here is a matrix that rotates 45° about the y axis:
Search WWH ::




Custom Search