terça-feira, 12 de maio de 2009

Processing II

Agora animado...


void setup(){
size(600,400);//tamanho da tela
frameRate(10);//velocidade
smooth();//suaviza contornos
}

void draw(){
noStroke();

//retângulos coloridos
fill(random(255),random(255),random(255),random(255));
rect(0,0,200,200);
fill(random(255),random(255),random(255),random(255));
rect(200,0,400,200);
fill(random(255),random(255),random(255),random(255));
rect(200,200,200,600);
fill(random(255),random(255),random(255),random(255));
rect(0,200,200,600);
fill(random(255),random(255),random(255),random(255));
rect(400,200,600,600);
fill(random(255),random(255),random(255),random(255));
rect(400,0,600,200);


//elipses
if(mouseX <= 200){
fill(mouseX, mouseY,mouseY,random(255));
ellipse(mouseX - random(50), mouseY, mouseX, mouseY - random(100));
}
if(mouseY <= 200){
fill(mouseX, mouseY,mouseY,random(255));
ellipse(mouseX - random(50), mouseY, mouseX, mouseY - random(100));
}

//triangulos
if(mouseX <= 400){
fill(mouseX, mouseY,mouseY,random(255));
triangle(mouseX - random(50), mouseY, mouseX, mouseY - random(100), mouseY, mouseX);
}
//quadrilateros
if(mouseX <= 600){
fill(mouseX, mouseY,mouseY,random(255));
quad(mouseX - random(50), mouseY, mouseX, mouseY - random(100), mouseY - random(100), mouseX - random(50), mouseY, mouseX);
}
noCursor();//mouse nao aparece

}

//fim

Nenhum comentário:

Postar um comentário