Files
FreeJ/scripts/processing/basic/rotate.pde
Jaromil ae7b1ad056 progresses on processing script
processing-js 0.4 has been merged in some relevant parts
basic and topic scripts added for test
color handling fixed, more scripts show up now
2010-02-12 18:36:54 +01:00

28 lines
369 B
Plaintext

void setup()
{
size(200,200);
noStroke();
fill(255);
frameRate(30);
}
float angle;
float cosine;
float jitter;
void draw()
{
background(102);
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, 115, 115);
}