Project 2: Scan converting Triangles


Here is my applet in action, on the cow and teapot:
 

Here is my applet in action on a triangle file I created by hand:
 

The Code

The source code I modified is here, in  Triangle.java . I also made a minor change to  Vertex2d.java  to add the methods alpha(), red(), green(), and blue() so that I had an easier way of retrieving the color components of  a vertex.

The accuracy of my color interpolation algorithm isn't all that great-- I suspect a flaw in my method. The actual triangle scan-converting is quite good.