Procion: Variation on a theme by Victor Vasarely
int N=4; float t, h;
void setup()
{
size(600,600); frameRate(30);ellipseMode(CORNER);
smooth(); noStroke(); colorMode(HSB,360,100,100);
t=0; h=0;
}
void draw()
{
t+=1/30.0; h=(h+0.1)%360;
background(0);
int i, j, w=width/N;
float f=0.05;
for(i=0;i<N*N;i++){
fill(h,80,80);
ellipse((f+i%N)*w,(f+int(i/N))*w,w*(1-2*f),w*(1-2*f));
fill(0,0,0);
rect((1/3.0+i%N)*w, (1/3.0+int(i/N))*w, w/3.0, w/3.0);
}
for(i=0;i<N*(N-1);i++){
rect((5/6.0+i%(N-1)+1/6.0*cos(0.3*t+(i%2)*PI))*w,
(1/3.0+int(i/(N-1)))*w, w/3.0, w/3.0);
rect((1/3.0+i%N)*w, (5/6.0+int(i/N)
+1/6.0*cos(0.3*t+((i+int(i/N))%2)*PI))*w,
w/3.0, w/3.0);
}
}
Return to top ⇑