VictorFlores:Arbol
De Casiopea
Título | arbolvictoreflores |
---|---|
Tipo de Proyecto | Proyecto de Curso |
Asignatura | Taller Inicial 1ª y 2ª Etapa, |
Del Curso | Imagen Escrita, |
Alumno(s) | Victor Flores Aguilera |
Profesor | Herbert Spencer |
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");
}