package p5;
import anar.*;




import processing.core.PApplet;



public class OOG01cSquare01 extends PApplet{
  
public void setup() {
  size(800, 400, OPENGL);
  Anar.init(this);

  initForm();
}

void initForm() {
  //Create a first point with absolute coordinates    
  Pt a = Anar.Pt(-60, -60);

  //Create two transformations
  Translate t1 = new Translate(120, 0, 0);
  Translate t2 = new Translate(0, 120, 0);

  //Create a first line
  Pts myLine1 = new Pts();

  //Create point b from point a with the translation t1
  Pt b = Anar.Pt(a,t1);   
  myLine1.add(a);
  myLine1.add(b);    

  Pt d = myLine1.pt(0);
  //d.x(15.00f);
  
  //Copy and move the first line
  Pts myLine2 = new Pts(myLine1);
  myLine2.apply(t2);

  //Create a new Face
  Face mySquare = new Face();

  //Store the points inside our Face
  myLine2.reverse();
  mySquare.add(myLine1);
  mySquare.add(myLine2);

  //Store mySquare in our object
  Anar.add(mySquare);

  //Create Sliders based on an object
  Anar.sliders(b);  
}

public void draw() {
  background(150);
  Anar.main.draw();
}
  public static void main(String[] args){
    PApplet.main(args);
  }
}
