Archivo:Arbolito.jpg

De Casiopea

Archivo original(500 × 700 píxeles; tamaño de archivo: 42 kB; tipo MIME: image/jpeg)

void setup() {

 size(500, 700);
 smooth();
 background(color(#E1FF6A));
}


void drawTree(float x, float y, float big, int levels) {
 pushMatrix();
 {
   translate(x, y);
 
   line(0, 0, 0, -big/2);         // base
   line(0, -big/3, -big/2, -big); // izquierda
   line(0,-big/2,0,-big);         // centro
   line(0, -big/4, big/2, -big);  // derecha
 
   // recursividad
   if (levels > 0) {
     stroke(0,random(17,500),0);
     drawTree(-big/4, -big, big*(random(.10,1)), levels - 1); // Y izquierda
     drawTree(big/2, -big, big*(random(.19,1)), levels - 3);  // Y derecha
     drawTree(0, -big,big*(random(.14,1)), levels - 2 );     // rama central
 
      
   }
 }
 popMatrix();

}

void draw() {
 
}
void mouseReleased() {
 drawTree(mouseX, mouseY, 100, round(9));
 saveFrame("arbolito.jpg");
}

Historial del archivo

Haz clic sobre una fecha y hora para ver el archivo tal como apareció en ese momento.

Fecha y horaMiniaturaDimensionesUsuarioComentario
actual10:06 30 nov 2011Miniatura de la versión del 10:06 30 nov 2011500 × 700 (42 kB)Victor flores (discusión | contribs.):::
10:01 30 nov 2011Miniatura de la versión del 10:01 30 nov 2011500 × 700 (42 kB)Victor flores (discusión | contribs.)void setup() { size(500, 700); smooth(); background(color(#E1FF6A)); } void drawTree(float x, float y, float big, int levels) { pushMatrix(); { translate(x, y); line(0, 0, 0, -big/2); // base line(0, -big/3, -big/2, -big); // iz
16:59 21 nov 2011Miniatura de la versión del 16:59 21 nov 2011500 × 700 (42 kB)Victor flores (discusión | contribs.)void setup() { size(500, 700); smooth(); background(color(#E1FF6A)); } void drawTree(float x, float y, float big, int levels) { pushMatrix(); { translate(x, y); line(0, 0, 0, -big/2); // base line(0, -big/3, -big/2, -b

La siguiente página usa este archivo: