import processing.opengl.*; import processing.opengl.*; import anar.*; /* * Example for Anar library by Guillaume LaBelle + Julien Nembrini * http://anar.ch */ Obj towerCore = new Obj(); Obj contourLines = new Obj(); Obj verticalLines = new Obj(); Obj windows = new Obj(); Obj structure = new Obj(); Obj allObjects = new Obj(); Sliders mySliders; boolean calculateWindows = false; boolean calculateVertical = false; void setup(){ size(800,400,OPENGL); Anar.init(this); // Setup DEFAULT rendering of our scene Pts.globalRender = new RenderPtsLine(); Anar.drawAxis(true); // Scene.lights = false; // anar.defaultScene = false; initForm(); } void initForm(){ // ////////////////////////////////////////// // ////////////////////////////////////////// // Initial SHAPE // Here, we create an arbitrary shape Face iShape; iShape = new Star(100,50,5); // ////////////////////////////////////////// // ////////////////////////////////////////// // LEVEL // The initial shape is duplicated Applying always the same predefined // Transformation Param numOfSubDivisionsOnEachSides = new Param(5); Transform combo = new Transform(); combo.translate(0,0,5); combo.scale(0.95f,0.985f,1.02f); combo.rotateZ(.06f); for (int i = 0; i<40; i++){ Face floorShape = new Face(iShape,combo); towerCore.add(floorShape); iShape = floorShape; } // ////////////////////////////////////////// // ////////////////////////////////////////// // VERTICALES if(calculateVertical){ for (int i = 0; i<40; i++){ Face shape = towerCore.face(i); Pts contour; Pts tmpPtList = new Pts(); for (int j = 0; j20&&frameCount%5==0){ // saveFrame("myFrame"+nf(((frameCount-25)/5),2)+".tga"); // Scene.autoRotateZ = 0.05f; // Scene.autoRotateX = -0.02f; // anar.scene.actualView.head(-60); // } // if(frameCount>99){ // this.stop(); // this.exit(); // } // ////////////////////////// } void keyPressed(){ switch(key){ case 'a': Autolisp.export(allObjects,this); break; case 'r': RhinoScript.export(allObjects,this); break; case 's': SketchUpRuby.export(allObjects,this); break; case 'm': // PovRay.export(allObjects,this); break; } }