SPONSORED LINKS

3.6.2 3D Transformation

In Chapter 3 you learned that you need to convert from one coordinate system to another in order to ultimately display a picture on the TV screen. Now this chapter shows you how to actually do the coordinate system transformations by using matrix calculations.

Usually, 3x3 matrices are used for two-dimensional coordinate transformations and 4x4 matrices are used for three-dimensional coordinate transformations. In addition, to display the coordinates of vertices, we show you how to use two-dimensional vectors [x y 1] and three-dimensional vectors [x y z 1].

In general, a matrix like the following is used for three-dimensional coordinate transformations:

The coordinate vector that specifies the vertex to be transformed is given as:

:

before the transformation and as:

:

after the transformation.

During the transformation process three different variations of the conversion matrix are created to apply scaling information, movement translation information, and rotational information.

Rotational Direction of Each Axis Rotation

As explained previously, N64 uses the right-handed coordinate system (see section 3.3.1, Right/Left Hand Co-ordinate System). In this system, the positive rotation of an axis is counter clockwise as you directly face the oncoming vector, so the positive direction of each coordinate axis rotation looks like this: