This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

anar+

by   LaBelle + Nembrini
©2008

built with ( )
   examples index
Rotate: middle click or key[1]
Zoom in|out: wheel button or key[2]
AutoRotate: key[5]
(First Click inside the applet to enable keys)

This applet use OpenGL, you might have to install extra jogl libraries once to view this applet. You may have a look at image capture and video at the bottom of this page. You might accept security security permenently to remove the security prompts on each pages.



sourcecode


   PDE Download:   Test04iTchenobyl.pde
   JAVA Download:   Test04iTchenobyl.java


Click on anar+ terms to get the documentation.

import processing.opengl.*;
import processing.opengl.*;
import anar.*;
 
 
 
 
/*
 * Example for Anar library by Guillaume LaBelle + Julien Nembrini
 * http://anar.ch
 */
 
 
Obj myObj;
 
void setup(){
    size(800,400,OPENGL);
 
    // this.hint(DISABLE_OPENGL_2X_SMOOTH);
 
  Anar.init(this);
  Anar.drawAxis();
 
  Scene.myOpenGLBackground = true;
 
  initForm();
}
 
void initForm(){
  Pt a = Anar.Pt( -30,30,0);
  Pt b = Anar.Pt(30,0,100);
 
  myObj = new Revolve(new Pts(a,b),60);
 
  Anar.slidersReset();
  Anar.sliders(a);
  Anar.sliders(b);
  Anar.camTarget(myObj);
 
  // println(myObj.parentList());
 
  // String[] st = new String[1];
  // st[0] = myObj.parentListGraphViz();
  // saveStrings(this.getClass().getName()+".dot", st);
 
 
  // Pts ncopy = new Pts(Anar.scene.actualView);
  // ncopy.rotateZ(PI/2f);
  // ncopy.stroke(255,0,0);
  // myObj.add(ncopy);
 
  Anar.add(myObj);
 
}
 
void draw(){
  background(255);
  myObj.draw();
}
 
// void keyPressed(){
// if(key==' ')
// initForm();
// if(key=='o')
// Anar.scene.actualView.ortho();
// if(key=='p')
// Anar.scene.actualView.unortho();
//    
//    
// }
 
void keyPressed(){
  switch(key){
    case ' ':
      initForm();
    break;
 
    case 'o':
      Anar.scene.actualView.ortho();
    break;
 
    case 'p':
      Anar.scene.actualView.unortho();
    break;
 
    case 'i':
      ObjExporter.export(Anar.main);
      RhinoScript.export(Anar.main);
      Autolisp.export(Anar.main);
      SketchUpRuby.export(Anar.main);
      PovRAY.export(myObj);
    break;
 
    case 'a':
      println(Anar.main.toANSYS());
      break;
  }
}
 
 



screenshots