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:   Test04yTurtle.pde
   JAVA Download:   Test04yTurtle.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
 */
 
boolean penDown      = true;
boolean cameraFollow = false;
 
Pts     trace        = new Pts();
Turtle  tip;
 
//  Param   f;
//  Param   t;
//  Param   r;
 
 
void setup(){
 
    size(screen.width,screen.height-100,OPENGL);
  Anar.chy(this);
  Anar.drawAxis(true);
 
//    f = new Param(1,0,10);
//    t = new Param(0.01f, -.1f,.1f);
//    r = new Param(0, -.1f,.1f);
//
//    Anar.sliders.add(f);
//    Anar.sliders.add(t);
//    Anar.sliders.add(r);
 
  tip = new Turtle();
}
 
 
void draw(){
  background(200);
 
//    tip.rotateXZ(r);
//    tip.rotateXY(t);
 
  tip.draw();
 
  if(cameraFollow)
    tip.setCameraOnTurtle();
}
 
 
void keyPressed(){
  if(key==' '){
    if(tip.penState)
      tip.PENUP();
    else
      tip.PENDOWN();
  }
 
  if(key=='j'||keyCode == LEFT)
    tip.LEFT(90/5f);
  if(key=='l'||keyCode == RIGHT)
    tip.RIGHT(90/5f);
 
  if(key=='i'||keyCode == UP)
    tip.FORWARD(20);
  if(key=='k'||keyCode == DOWN)
    tip.BACK(20);
 
  if(key=='q')
    cameraFollow = cameraFollow ? false:true;
 
 
}
 
 
 



screenshots