// iuna taller de produccion multimedial dos // aņo 2007 // ayesa leandro // ejercicio tres tp tres void setup(){ size(300,300); //tamaņo de pantalla noLoop(); } void draw(){ //defino el color de fondo en negro background(0); //repite forma 20 veces for(int i=0; i<20; i=i+1){ //determina posicion al azar float x=random(300); float y=random(300); //dibuja forma forma(x,y); } } void forma(float x, float y){ //determino color al azar float r=random(255); float g=random(255); float b=random(255); fill(r,g,b); noStroke(); //dibuja forma //ariba beginShape(); vertex(x, y); vertex(x+50, y); vertex(x+50, y+90); vertex(x+40, y+90); vertex(x+40, y+10); vertex(x+10, y+10); vertex(x+10, y+50); vertex(x, y+50); endShape(); //abajo beginShape(); vertex(x, y+70); vertex(x+10, y+70); vertex(x+10, y+150); vertex(x+40, y+150); vertex(x+40, y+110); vertex(x+50, y+110); vertex(x+50, y+160); vertex(x, y+160); endShape(); //izquierda beginShape(); vertex(x-50, y+55); vertex(x+35, y+55); vertex(x+35, y+65); vertex(x-40, y+65); vertex(x-40, y+95); vertex(x-5, y+95); vertex(x-5, y+105); vertex(x-50, y+105); endShape(); //derecha beginShape(); vertex(x+15, y+105); vertex(x+15, y+95); vertex(x+90, y+95); vertex(x+90, y+65); vertex(x+55, y+65); vertex(x+55, y+55); vertex(x+100, y+55); vertex(x+100, y+105); endShape(); }