Game Development Reference
In-Depth Information
These matrices are orthonormal, this means that the vectors are orthogonal, in other words,
the vectors are perpendicular with respect to each other. Also, each of the vectors in the
matrix has unit length; we know this to be true because from the beginning we derived
all our equations off of a unit circle. This property implies that the product of two or-
thonormal matrices will beanorthonormal matrix, therefore the product ofaseries orrota-
tion matrices will also result in a rotation matrix.
We can derive a general rotation matrix by concatenating a series of rotation matrices,
namely the rotation matrix for each of the axes. The order in which the matrices are con-
catenated will define the order in which the rotations are applied, thus:
Where R is general rotation matrix that will rotate about the x axis, then the y axis and fi-
nally about the z axis.
At this point we are able to rotate any point about any (or all) axes in 3D, provided that the
points are rotated around the origin. What we will need is the ability to rotate any points
around an arbitrary origin.
matrix CreateRotationX(float radians)
{
const float cosine = cosf(radians);
const float sine = sinf(radians);
return matrix(
1.0, 0.0, 0.0, 0.0,
Search WWH ::




Custom Search