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:   Test02kRND.pde
   JAVA Download:   Test02kRND.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
 */
 
 
RenderPt[] r = new RenderPt[3];
 
void setup(){
    size(800,400,OPENGL);
  frameRate(200);
 
  Anar.init(this);
  Anar.drawAxis();
  Anar.drawReferenceFrame(true);
  r[0] = Anar.renderPtShapeOriented(new FatCross(25),color(255),color(255));
  r[1] = Anar.renderPtShapeOriented(new Star(5,3,5),color(255),color(255));
  r[2] = new RenderPtObj(new Box(5).fill(255,200));
 
 
  red(10);
 
  Anar.seed(0);
  Obj.globalRender = new RenderObjAll();
 
  initForm();
}
 
 
void initForm(){    
  Pts p = new Pts();
 
  for (int i = 0; i<200; i++)
    Anar.add(Anar.PtRnd(200).render(r[Anar.rndi(3)]));
}
 
 
void draw(){
  background(255,0,0);
  noLights();
  Anar.draw();
 
  fill(255);
  Anar.text3D(Anar.pt(0).toString(),Anar.pt(0));
  Anar.text3D("Hello mom! "+frameCount,Anar.pt(1));   
}
 
void keyPressed(){
  Anar.rndReset();
  Anar.main.remove(Anar.main.obj(0));
  Anar.main.add(new Obj());
 
  if(key=='q')
    Anar.rndPrev();
  if(key=='w')
    Anar.rndNext();
 
  initForm();
}
 
 



screenshots