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


Click on anar+ terms to get the documentation.

import processing.opengl.*;
import anar.*;
 
 
 
 
 
 
 
 
Obj myObj = new Obj();
 
void setup(){
  size(800,400,OPENGL);
frameRate(200);
 
Anar.init(this);
Anar.drawAxis(true);
 
initForm();
}
 
void initForm(){
 
//Create a new Face
Face mySquare = new Star(1,2,5);
 
//Create a new set of Transformations
Transform myTransform = new Transform();
myTransform.translate(2,0,0);
myTransform.rotateZ(.5f);
myTransform.scale(1,1.05f,1.015f);
 
//Create a box from the previous square
Obj box = new Extrude(mySquare,Anar.Pt(0,0,10));
 
for(int i=0; i<200; i++)
{
  Obj myCopy = new Obj(box);  //Create an obj from box
  myCopy.apply(myTransform);  //Apply the set of transformations to the copy
  if(random(2)>1)
    myObj.add(myCopy);        //Add myCopy obj to my main obj myObj
  box = myCopy;               //Swap box <--> myCopy
                              //    myCopy is now the base for the next loop
}
 
Anar.camTarget(myObj);
 
//Get the sliders from the set of transform
//    Note: here, we don't use an obj to create the sliders.
Anar.sliders(myTransform);
}
 
void draw(){
background(155);
myObj.draw();
}
 



screenshots