Javiera Ramírez Arbol real

De Casiopea
Javiera Ramírez-Arbol


TítuloJaviera Ramírez-Arbol
Tipo de ProyectoProyecto de Taller
Período2011-
AsignaturaImagen Escrita,
CarrerasArquitectura
Alumno(s)Javiera Ramírez
ProfesorHerbert Spencer

void setup() {

 size(600, 500);
 smooth();
 background(#8B6798);

}

void drawTree(float x, float y, float big, int levels) {

 pushMatrix();
 {
   translate(x, y);
   if (levels < 20);
   line(0, 0, 0, -big/2); 
   strokeWeight(5);
   line(0, -big/2, -big/2, -big);
   line(0, -big/2, big/2, -big);
   rect (big/2, -big, 30, 30 );
   rect (-big/2, -big, 30, 30);


   fill  (random(200, 250), random(60, 200), 0);
   fill(random(113, 243), random(200, 255), random(80, 300));


   // recursividad
   if (levels > 0) {
     drawTree(-big/2, -big, big*0.8, levels - 1); // Y izquierda
     drawTree(big/2, -big, big*0.8, levels - 1);  // Y derecha
   }
 }
 popMatrix();

}

void draw() { }

void mouseReleased() {

 drawTree(mouseX, mouseY, random(60, 100), round(random(1, 12)));

} void mouseClicked() {

 redraw();
 {
   saveFrame("arboljade.jpg");
 }

}