ejemplos de processing:
void setup(){ size(300,200); noStroke(); fill(200); frameRate(50);}
float angle;float cosine;float jitter;
void draw(){ background(300); if(second()%2 == 0){ jitter = (random(-0.1, 0.1)); } angle = angle + jitter; cosine = cos(angle); translate(width/2, height/2); rotate(cosine); rectMode(CENTER); rect(0, 0, 120, 120); }
void setup()
{
size(100,200); noStroke(); fill(220); frameRate(30);
}
float angle; float cosine; float jitter;
void draw()
{ background(100);
if(second()%2 == 0){
jitter = (random(-0.1, 0.1));
}
angle = angle + jitter;
cosine = cos(angle);
translate(width/2, height/2);
rotate(cosine);
rectMode(CENTER);
rect(0, 0, 110, 110);
}
{
size(100,200); noStroke(); fill(220); frameRate(30);
}
float angle; float cosine; float jitter;
void draw()
{ background(100);
if(second()%2 == 0){
jitter = (random(-0.1, 0.1));
}
angle = angle + jitter;
cosine = cos(angle);
translate(width/2, height/2);
rotate(cosine);
rectMode(CENTER);
rect(0, 0, 110, 110);
}
No hay comentarios:
Publicar un comentario