import java.awt.Color;

/**
 * A driver that can be used to test the Rasterizer3D class
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class ViewTests
{
    /**
     * The entry point of the application
     *
     * @param args   The command line arguments
     */
    public static void main(String[] args)
    {
       FrameBuffer      fb;       
       GraphicsWindow   window;
       Rasterizer3D     rasterizer;
       

       window = new GraphicsWindow();

       fb = window.getFrameBuffer();

       rasterizer = new Rasterizer3D(fb);


       double[][] coords = 
          {
             {   0.,   0.,   0.,  1.}, // 0
             {   0.,   0.,  50.,  1.}, // 1
             {   0.,  50.,  50.,  1.}, // 2
             {   0.,  50.,   0.,  1.}, // 3
             {  50.,   0.,   0.,  1.}, // 4
             {  50.,   0.,  50.,  1.}, // 5
             {  50.,  50.,  50.,  1.}, // 6
             {  50.,  50.,   0.,  1.}  // 7
          };

       
       int[][] faces = {{1,5,6,2}, // Front
                        {1,2,3,0}, // Left
                        {3,2,6,7}, // Top
                        {7,4,0,3}, // Back
                        {7,6,5,4}, // Right
                        {5,1,0,4}  // Bottom
                       };

       Color[] colors = {Color.BLACK,  // Front 
                         Color.BLUE,   // Left  
                         Color.RED,    // Top   
                         Color.GREEN,  // Back  
                         Color.YELLOW, // Right 
                         Color.WHITE   // Bottom
                      };

       //rasterizer.useIsometricView();
       //rasterizer.useDimetricView(20.705); // Foreshorten the z-axis by 1/2
       //rasterizer.useTrimetricView(30.0, 30.0);
       rasterizer.useTwoPointPerspectiveView(50.0, -100.0, 50.0, 60.0);
       //rasterizer.useThreePointPerspectiveView(50.0, 50.0, -100.0, 50.0, 45.0, 60.0);
       

       rasterizer.draw(colors, faces, coords);
       


       fb.show();
    }
}
