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:   Test05aTurtle.pde
   JAVA Download:   Test05aTurtle.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
 */
 
Turtle t = new Turtle();
 
 
void setup(){
    size(800,400,OPENGL);
  Anar.init(this);
  Anar.drawAxis(true);
 
  Turtle.debug = true;
 
  t.LOGO("cs pu setxy -60 60 pd home rt 45 fd 85 lt 135 fd 120");
  t.LOGO(" fd     60 rt 120 fd 60 rt 120 fd 60 rt 120 ");
 
 
 
 
  t.LOGO("repeat 3 [fd 60 rt 120]");
 
  t.SETPC(55,55,255);
 
  t.LOGO("home repeat 10 [fd 100 repeat 5 [dw 21 rt 10 fd 10] pu fd 10 pd fd 10]");
 
  t.SETPC(255,255,0);
 
  t.LOGO("rt 100 fd 100 home rt 90 bk 20 pu setpos [100 0] pd fd 100; Hello Anar!");
 
  t.SETPC(255,0,0);
 
  t.HOME();
  t.DW(10);
  t.FORWARD(100);
  t.DOWN(20);
  t.FD(100);
 
  t.FD(100).PU().PD();
 
  //IN FRENCH!
  t.SETPC(155,155,255);
  t.LOGO("LEVECRAYON ORIGINE BAISSECRAYON AVANCE 100 Gauche 20 AT 20 Droite 40 RE 20 REPETE 3 [AT 10 TD 10 RE 3 TD 10]");
 
  //LA VERSION FRANCAISE
 
//     t.LOGO("cs");
 
 
  println(t.trace);
}
 
 
void draw(){
  background(200);
 
//     t.LOGO("cs repeat 10 [fd "+frameCount+" rt 10 up 20 repeat 5 [fd 10 lt 5 dw 65] ]");
 
  t.draw();
 
  Tortue tortue = new Tortue();
  tortue.AVANCE(10);
  tortue.DROITE(10);
  tortue.LEVECRAYON();
  tortue.RECULE(10);
  tortue.BAISSECRAYON();
  tortue.GAUCHE(20);
  tortue.AVANCE(20);
  tortue.GAUCHE(5);
  tortue.dessine();
}
 
 
 
 



screenshots