# 2.2.8 3D 3D Geometry Calculations

Geometry calculations, which mainly calculate coordinate transformations, play a leading role in the 3D process.

## Matrix

A matrix (two-dimensional array) forms the core of the coordinate transformation process. A matrix is used to convert from one coordinate system to another. A matrix 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.

## 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:

- Local Coordinate System also known as Device or Object Coordinate System
- World Coordinate System
- Frame Buffer Coordinate System

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).

## Transformation Matrix

A model view matrix defines where to place the model (the object to be displayed) in the world coordinate system. The depth of the matrix stack varies depending on which microcode is being used.

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.

Nintendo® Confidential
Copyright © 1999
Nintendo of America Inc. All Rights Reserved
Nintendo and N64 are registered trademarks of Nintendo
Last Updated March, 1999