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


Click on anar+ terms to get the documentation.

import processing.opengl.*;
import anar.*;
 
 
import rad.*;
 
 
 
	RadEngine engine;
 
	Obj obj;
 
 
  //#  red  green  blue  specularity  roughness  #
	final double[] matParam = {  0.3f,  0.3f,  0.5f,  0.01f,  0.01f };
 
	final float subdivMax = 1000f;
 
	void setup() {		
		//size(screen.width,screen.height, P3D);
		size(1000,500, OPENGL);
 
		Anar.chitecture(this);
		Anar.drawAxis();
 
		obj = new Obj();
 
		// first square
 
		Face square1 = new Face();
 
		Param cote = new Param(100,1,200);
		Anar.sliders.add(cote);
 
		Param mCote = new ParamMul(cote,-1);
 
		TranslateX coteX = new TranslateX(cote); 
		TranslateY coteY = new TranslateY(cote); 
		TranslateX mCoteX = new TranslateX(mCote); 
		TranslateY mCoteY = new TranslateY(mCote); 
		Pt origin = Anar.Pt(0,0);
		square1.add(Anar.Pt(origin,coteX));
		square1.add(Anar.Pt(origin,coteY));
		square1.add(Anar.Pt(origin,mCoteX));
		square1.add(Anar.Pt(origin,mCoteY));
 
		obj.add(square1);
 
		// second square
 
		Param angle = new Param(PI/2,0,PI);
		Anar.sliders.add(angle);
 
		Face square2 = new Face(square1);
		square2.rotateX(angle);
 
		obj.add(square2);
 
		Param rotation = new Param(0,0,2*PI);
		Anar.sliders.add(rotation);
 
		RotateZ t = new RotateZ(rotation);
		obj.apply(t);
 
		Anar.add(obj);
 
 
		// initialise the simulation thread
		engine = new RadEngine(this, subdivMax);
		RadEngine.debug = true;
 
		engine.objToMeasure.add(obj);
		engine.scene.add(obj);
//		RadEngine.measureBack = true;
 
		// start the simulation 
		// this only launches the thread, 
		// simulation steps will be actually done using runNow() method
		engine.start();		
 
 
	}
 
	@Override
	synchronized void radSimDone() {
		println("back in applet");
 
	}  
 
	void keyPressed() {
  	if (key == 'q') engine.runNow();
  	if (key == ' ') saveFrame("screen.jpg");
  }
 
 
	synchronized void draw() {
 
		background(255);
		Anar.draw();
 
	}
 
 
 



screenshots