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:   Test02aLinesAndFaces.pde
   JAVA Download:   Test02aLinesAndFaces.java


Click on anar+ terms to get the documentation.

import processing.opengl.*;
import anar.*;
 
 
 
 
/*
 * Example for Anar library by Guillaume LaBelle + Julien Nembrini
 * http://anar.ch
 */
 
 
Pts  ptsA  = new Pts();
 
Pt   pta   = Anar.Pt(00,00,00);
Pt   ptb   = Anar.Pt(10,10,00);
Pt   ptc   = Anar.Pt(00,20,00);
Pt   ptd   = Anar.Pt(10,30,00);
Pt   pte   = Anar.Pt(00,40,00);
Pt   ptf   = Anar.Pt(90,50,00);
 
Face f;
 
Obj  myObj = new Obj();
 
void setup(){
    size(800,400,OPENGL);
  Anar.init(this);
  initForm();
}
 
void initForm(){
  /*
   * Pt pta = Anar.Pt(0, 0, 0); Pt ptb = Anar.Pt(1, 1, 0); Pt ptc =
   * Anar.Pt(0, 2, 0); Pt ptd = Anar.Pt(1, 3, 0); Pt pte = Anar.Pt(0, 4,
   * 0); Pt ptf = Anar.Pt(9, 5, 0);
   */
 
  ptsA.add(pta);
  ptsA.add(ptb);
  ptsA.add(ptc);
  ptsA.add(ptd);
  ptsA.add(pte);
  ptsA.add(ptf);
 
  f = new Face(ptsA);
 
  myObj.add(f);
 
}
 
void draw(){
  if(frameCount%2==0)
    background(155);
  else
    background(153);
 
  // origin.draw();
  // ptsA.draw();
 
  // pta.draw();
  // ptb.draw();
  // ptc.draw();
  // ptd.draw();
  // pte.draw();
  // ptf.draw();
 
  // f.draw();
 
  myObj.draw();
 
  // ptsB.draw();
  // myObject.draw();
  // a.draw();
  // pts.color(Color.HSBtoRGB(frameCount%255,55,200));
}
 
 
void keyPressed(){
  if(key=='a')
    ((PtABS)ptsA.pt((int)random(ptsA.numOfPts()))).set(random(100),random(100),random(100));
  if(key=='s')
    ((PtABS)f.pt((int)random(f.numOfPts()))).set(random(100),random(100),random(100));
}
 
 
 



screenshots