Game Development Reference
In-Depth Information
1.3.3 Rotation in 3D
Modern user interfaces in games are not constrained to a 2D plane on the screen, most re-
cent games are applying user interface elements directly within the game world, it is im-
portant for this reason to understand how transformations in 3D space work.
Now that we are able to perform a rotation in 2D, we can extend this concept to 3D, the
idea is that we are able to perform a rotation as we have described so far about each of the
axes in 3D. In other words, if we want to rotate in 3D about the z axis we need to keep it
unchanged.
Similarly,wecanderivetherotation equationsfortheotheraxes,alwayskeepingtheangle
you want to rotate about unchanged.
Rotation about the y axis:
Rotation about the x axis:
So far we have used a matrix in 2D to represent our rotation, what we need now is to rep-
resent the rotations about each of the axes in 3D, the matrix in 3D for each of the axes are
given by the following:
Search WWH ::




Custom Search