6.837 Project 4

3D graphics pipeline
Bruce Po - 11.23.98

 

Project instructions
source files: Project4.java
Matrix3D.java
Triangle.java
Vertex3D.java
Raster.java
ZRaster.java
Drawable.java
Point3D.java
Light.java
Surface.java
compiled class files: EdgeEqn.class
Light.class
Matrix3D.class
Matrix3x3.class
Point3D.class
Project4$SymMouse.class
Project4$SymMouseMotion.class
Project4.class
Raster.class
Surface.class
Triangle.class
Vertex3D.class
ZRaster.class

The Java program reads a list of vertices, surfaces, and lights from the file cow.obj and renders into a raster. For this project the graphics pipline implements:

  • correct normals transformation
  • calculation of normals at each vertex
    This is useful for more sophisticated illumination techniques which I didn't have the time to implement.
  • backface culling
  • directional and an ambient light sources
  • per triangle shading with support for ambient and diffuse reflection
  • polygon clipping in x, y, and z
    Unforunately I haven't been able to fix all the bugs so I disabled this feature. An applet with the feature enabled can be found here.
  • z-buffering

For z-buffering and triangle rasterization I used code that was given out in class. The matrix class is my own, taken from Project 3.

Java 1.1 and higher is required in order to run this applet. If you are on MIT's Athena you can still run the applet by running:

add imagery4 java
cd /mit/imagery4/6.837/F98/igan/Project4.2
appletviewer index.html &


To move the model or camera around click and hold on the image, and in time only the vertices will be visible, allowing more interactive control.

 

Return to Bruce's 6.837
igan@mit.edu ... last modified 11.23.98