3D Matrices

For Wednesday February 12, by class time, I would like you to do an assignment equivalent to the one you did this last week, but rather than using 3x3 matrices to do 2D transformations, implement a library of 4x4 matrices to do 3D transformations.

Here are notes on matrix 3x3 primitives.

You should structure your Matrix4x4 java class the same way you structured your Matrix3x3 java class.

For example, in order to create a

method, you would implement a
method, which makes use of a static helper method
doMakeTranslation(tx,ty,tz, dst[][]),
and then call a
doPostMultiply(srcData1[][], srcData2[][], dstData[][])
method, very much like the way you did things last week.


transform(x,y,z, dstVec[])
method should look very similar to the one you implemented last week, with the exception that now it works with a 4x4 matrix and an (x,y,z) vector. rather than with a 3x3 matrix and an (x,y) vector.

Just like last week, you should create a cool scene by drawing lines or polygons, using the java.awt.Graphics methods. After you are all done transforming the points in your scene's shapes, you can display them by simply ignoring their z coordinate, and drawing them as x,y points.

Next Monday we will go over perspective, so you will have some time before Wednesday to incorporate that into your work if you are feeling ambitious.