View the code ⇓

Gamma: Variation on a theme by Victor Vasarely

int NUM_CIRCLES=24, delta_R=12, square=170;
float t, w, h2, s2, X, Y;

void setup() 
{
  size(600,600); frameRate(30); noFill(); 
  colorMode(HSB,360,100,100,100); smooth(); ellipseMode(CENTER);
  t=0; w=0.6; h2=random(0,360); s2=random(50,100);
  X=width/2; Y=height/2;
}

void draw() 
{
  float theta, r; int i,j;
  background(0);
  t+=1/30.0; h2=(h2+0.1)%360;
  for(i=0;i<NUM_CIRCLES;i++){
    r=delta_R*i; 
    stroke(h2,s2,65+15*cos(2*PI*i/(NUM_CIRCLES*1.0)-t));
    if(rsquare*sqrt(2)){
      strokeWeight(3); ellipse(X,Y,2*r,2*r);}
    else{
      theta=acos(square/r);
      for(j=0;j<4;j++){
        strokeWeight(3);
        arc(X,Y,2*r,2*r,j*PI/2-theta+w*t,j*PI/2+theta+w*t);
        strokeWeight(6);
        arc(X,Y,2*r,2*r,j*PI/2+theta+w*t,(j+1)*PI/2-theta+w*t);
      }
    }
  }  
}

Return to top ⇑