2-8 3D Geometry Calculations


Geometry calculations, which mainly calculate coordinate transformations, play a leading role in the 3D process. These calculations are explained in detail in the STEP 3 [N64 Audio Architecture and Samples]


2-8-1 Matrix


A matrix (two-dimensional array) forms the core of the coordinate transformation process. It is used to convert from one coordinate system to another, and is specified in this manner:

float mf[4][4];

This matrix consists of 16 elements (4 lines by 4 columns), so it can hold all the modulation elements of the coordinate translation, rotation, projection, and scaling at the same time. The geometry calculations that use these matrices would take a long time if they were calculated by the CPU, so when N64 needs to do a geometry calculation, the RCP takes over. The RCP does the actual calculation and processes the coordinate transformation much more quickly than the CPU could. After completing the calculations, the RCP puts the result back into the display list for use by the CPU.



2-8-2 Coordinate System


The 3D rendering process ultimately loops through the coordinate transformation process several times to process the two-dimensional coordinate system of the frame buffer image. N64 uses the following three coordinate systems:

The coordinate data is converted in order from the beginning. Two transformation matrices are used. The local to world coordinate transformation uses a model view matrix (A), and the world to frame buffer coordinate transformation uses a projection matrix (B).


The following are the contents of the transformation matrices:

  1. Model View Matrix

  2. A model view matrix defines where to place the model (the object to be displayed) in the world coordinate system. The matrix storage holds 10 columns of the matrix-stack. Note: The depth of the matrix stack varies depending on which microcode is being used.

  3. Projection Matrix

  4. A projection matrix defines how each object placed in the world coordinate system is actually reflected in the frame buffer. The RCP has a "state" area where it stores the model view matrix and the projection matrix. The RCP is continually updated during the analysis of the display list, and it performs the vertex calculations. As the RCP completes these operations, the CPU constructs the display list.