Ground Rules:
public class MatrixStack extends Matrix4x4 { public MatrixStack(); // matrix stack with default depth public MatrixStack(int depth); // matrix stack with specific depth public MatrixStack(Raster r); // Initialize with viewport mapping (default depth) public MatrixStack(Matrix4x4 copy); // Initialize with matrix (default depth) public void push(); // Push copy of current tos public void pop(); // Pop matirx to current tos public void set(int j, int i, float val); // set element of current matrix[4][4] public void set(int i, float val); // set element i of current matrix[16] public float get(int j, int i); // get element of current matrix[4][4] public float get(int i); // get element of current matrix[16] public void copy(Matrix4x4 src); // copy matrix to current matrix // Transform one list of 3D vertices to another using the matrix // on the top of the stack. The in and out arrays can be the same. public void transform(Vertex3D in[], Vertex3D out[], int vertices); public Vertex3D transform(Vertex3D in); // transform a single vertex using the // matrix on the top of the stack public final void compose(Matrix4x4 M); // compose the matrix M with the matrix // on the top of the stack: // M[tos] <- M[tos]*M public void loadIdentity(); // load the current matrix with identity public void mult(float r[]); // compose the tos with the 16 element array public void translate(float tx, float ty, float tz); // compose the tos with a translation public void scale(float sx, float sy, float sz); // compose the tos with a scale public void rotate(float ax, float ay, float az, float angle); // compose the tos with a rotation public void lookAt(float eyex, float eyey, float eyez, // compose the tos with a viewing matrix float atx, float aty, float atz, float upx, float upy, float upz); public void frustum(float left, float right, // compose the tos with a prespective float bottom, float top, // projection matrix float near, float far); public String toString(); }