Katherine Leiva - Árbol
De Casiopea
Título | Katherine Leiva - Árbol |
---|---|
Tipo de Proyecto | Proyecto de Taller, Proyecto de Curso |
Carreras | Diseño Gráfico"Diseño Gráfico" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property., Diseño Industrial"Diseño Industrial" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property. |
void setup() {
size(400, 600); smooth(); background(#E2FC24);
}
void drawTree(float x, float y, float big, int levels) {
pushMatrix(); { translate(x, y); line(0, -big/2, -big/2, -big); line(0, -big/2, 0, -big); line(0, -big/2, big/2, -big); line(0, 0, 0, -big/2);
if (levels > 0) { stroke(0, random(30, 150), 0); drawTree(-big/2, -big, big*(random(.5, 1)), levels - 1); drawTree(big/2, -big, big*(random(.5, 1)), levels - 1); drawTree(0, -big*(random(.3, 1)), big*0.4, levels - 1 ); } } popMatrix();
} void drawTronco(float x, float y, float x1, float y2) {
strokeWeight(18); { stroke(#402800); line(x, y, x1, y2); }
}
void draw() { }
void mouseReleased() {
drawTree(mouseX, mouseY, 76, round(9)); drawTronco(mouseX, mouseY, mouseX, mouseY-110);
}