Project2: Triangle Rasterization

This page illustrates the results of a simple triangle rasterizing algorithm. It uses an edge-walking approach, and the colors are interpolated using plane equations. Below you will find 4 applets: a cow, a teapot, a hexcone, and some assorted triangles. For the first 3, you will originally see a ppm image, with a mouse click you will see my rendered image, and with a 3rd click you will see the differences. For the 4th image, there is no ppm image, so the first and 3rd screens will make no sense. The second image, however, shows triangles in the spectrum of orientations to see that the algorithm does indeed work for all cases. Note: I ran out of time to completely debug the color interpolation. Since the pictures look better at this point without the color interpolation, I have the coloring code commented out where the pixels are actually drawn. The code driving them is still present, as are the commented lines so that the friendly grader might be able to see what I was trying to do.

WARNING: This page takes a LONG time to load! Once the ppm images are loaded, however, the algorithms run very quickly.





Remember....in this applet, the Reference image and statistics are not applicable.


Source Code:

Raster.java
Drawable.java
ppmDecoder.java
EdgeEqn.java
TriTest.java
Triangle.java