Pamela Juárez: árbol
De Casiopea
Título | árbol |
---|---|
Del Curso | Imagen Escrita, |
Carreras | Arquitectura |
Alumno(s) | Pamela Juárez |
Profesor | Herbert Spencer |
void setup() { size(500, 1000); smooth(); background(color(#A57932)); } void drawTree(float x, float y, float big, int levels) { pushMatrix(); { translate(x, y); line(0, 0, 0, -big/2); // tronco line(0, -big/2, -big/2, -big); // brazo izquierdo line(0, -big/2, big/2, -big); // brazo derecho line(1, -big/3,big/2, -big); //brazo1 line(1, -big/3,-big/2, -big); //brazo2 // recursividad if (levels > 0) { stroke(0,random(0,500),100); drawTree(-big/2, -big, big*(random(.2,1)), levels - 1); // Y izquierda drawTree(big/2, -big, big*(random(.2,1)), levels - 2); // Y derecha drawTree(big/2, -big, big*(random(.2,1)), levels - 2); // Y 1 drawTree(-big/2, -big, big*(random(.2,1)), levels - 1); // Y 2 } } popMatrix(); } void draw() { } void mouseReleased() { drawTree(mouseX, mouseY, 60, round(6)); saveFrame("arbolPamelaJC.jpg"); }