Modified Draw( ) Method
Compute the plane equation for each parameter.
    public void Draw(Raster raster) {
        if (isFlat) {
            super.Draw(raster);
            return;
        }
		
        int width = raster.getWidth();
        int height = raster.getHeight();
        if (!triangleSetup(width, height)) return;
		
        int alpha[] = new int[3];
        int red[] = new int[3];
        int green[] = new int[3];
        int blue[] = new int[3];
        
        int t0 = v[0].argb;
        int t1 = v[1].argb;
        int t2 = v[2].argb;
        PlaneEqn(blue, t0 & 255, t1 & 255, t2 & 255);
        t0 >>= 8;   t1 >>= 8;   t2 >>= 8;
        PlaneEqn(green, t0 & 255, t1 & 255, t2 & 255);
        t0 >>= 8;   t1 >>= 8;   t2 >>= 8;
        PlaneEqn(red, t0 & 255, t1 & 255, t2 & 255);
        t0 >>= 8;   t1 >>= 8;   t2 >>= 8;
        PlaneEqn(alpha, t0 & 255, t1 & 255, t2 & 255);
	
Lecture 6   Slide 27   6.837 Fall '01