import processing.opengl.*; import anar.*; /* * Example for Anar library by Guillaume LaBelle + Julien Nembrini * http://anar.ch */ Obj myObj = new Obj(); void setup(){ size(800,400,OPENGL); frameRate(200); Anar.init(this); Anar.drawAxis(true); initForm(); } void initForm(){ // CREATE TWO CONTAINERS TO STORE THE POINTS // TWO LINES PARRALELS WITH POINTS Pts ptsA = new Pts(); Pts ptsB = new Pts(); // SET TWO TRANSFORMATIONS FOR REUSE Translate sideWidth = new Translate(0,30,0); Translate sideHeight = new Translate(10,10,10); // CREATE A FIRST POINT // ASECOND FOR THE NEXT LINE Pt oriA = Anar.Pt(10,20,0); Pt oriB = Anar.Pt(oriA,sideWidth); // CREATE ALL POINTS FROM sideHeight at EACH STEPS for (int i = 0; i<20; i++){ Pt tmpA = Anar.Pt(oriA,sideHeight); Pt tmpB = Anar.Pt(oriB,sideHeight); ptsA.add(tmpA); ptsB.add(tmpB); // Swap oriA and oriB oriA = tmpA; oriB = tmpB; } RotateY r = new RotateY((float)Math.PI/16); // I HAVE THEN TWO PARRALLEL LINES // I'LL CREATE FACES FROM EACH PAIRS for (int i = 0; i