package org.stuygfx;

import java.io.IOException;

import org.stuygfx.graphics.Draw;
import org.stuygfx.graphics.EdgeMatrix;
import org.stuygfx.graphics.Image;
import org.stuygfx.graphics.Pixel;
import org.stuygfx.graphics.Point;
import org.stuygfx.math.Matrix;
import org.stuygfx.math.MatrixMath;
import org.stuygfx.math.Transformations;

public class Main {

    public static void main(String[] args) throws IOException {
        Image img = new Image();
        img.shouldRelectOverX(true);

        Point center = new Point(img.XRES / 2, img.YRES / 2);
        Pixel green = new Pixel(0, 255, 0);
        Pixel blue = new Pixel(0, 0, 255);
        Pixel red = new Pixel(255, 0, 0);
        Pixel yellow = new Pixel(255, 255, 0);

        EdgeMatrix em = new EdgeMatrix();
        em.addEdge(new Point(-50, 50), new Point(50, 50));
        em.addEdge(new Point(50, 50), new Point(50, -50));
        em.addEdge(new Point(50, -50), new Point(-50, -50));
        em.addEdge(new Point(-50, -50), new Point(-50, 50));

        for (int i = 0; i < 3; i++) {
            Matrix rot = Transformations.getRotZMatrix(30.0);
            Matrix trans = Transformations.getTranslationMatrix(img.XRES / 2, img.YRES / 2, 0);
            Matrix master = MatrixMath.crossProduct(trans, rot);

            Transformations.applyTransformation(master, em);
            Draw.edgeMatrix(img, green, em);

            // Reset the translation
            Matrix reset = Transformations.getTranslationMatrix(-img.XRES / 2, -img.YRES / 2, 0);
            Transformations.applyTransformation(reset, em);
        }

        PPMGenerator.createPPM("test.ppm", img);
        System.gc();
    }

}

@@ -613,120 +613,30 @@
 xel 
-blue = new Pixel(0, 0, 255);%0A        Pixel red = new Pixel(255, 0, 0);%0A        Pixel yellow = new Pixel(255, 255
+red = new Pixel(255, 0
 , 0)
@@ -1496,16 +1496,685 @@
      %7D%0A%0A
+        // Clear for testing curves%0A        em.empty();%0A%0A        em.addCircle(center, 100);%0A        em.addBezierCurve(0, 0, 256, 0, 256, 512, 512, 512);%0A        em.addBezierCurve(512, 512, 256, 0, 256, 512, 0, 0);%0A        em.addBezierCurve(0, 0, 0, 256, 512, 256, 512, 512);%0A        em.addBezierCurve(512, 512, 0, 256, 512, 256, 0, 0);%0A        Draw.edgeMatrix(img, red, em);%0A%0A        Matrix rot = Transformations.getRotZMatrix(90.0);%0A        Matrix trans = Transformations.getTranslationMatrix(img.XRES, 0, 0);%0A        Matrix master = MatrixMath.crossProduct(trans, rot);%0A        Transformations.applyTransformation(master, em);%0A        Draw.edgeMatrix(img, red, em);%0A%0A
         

Update Main