Variations on themes by Victor Vasarely

Victor Vasarely

Beta

Canvas that uses the Processing file VV_Beta.pde
Code Home
Victor Vasarely

Beta Code

Beta: Variation on a theme by Victor Vasarely

int NUM=23, delta_X;
float t, w, h2, s2, X, Y, radius;

void setup() 
{
  size(600,600); frameRate(30); noFill(); 
  colorMode(HSB,360,100,100); smooth();
  t=0; w=0.6; h2=random(0,360); s2=random(50,100);
  X=width/2; Y=height/2; delta_X=width/(2*NUM);
}
void draw() 
{
  float x, y; int i; t+= 1/30.0; h2=(h2+0.1)%360;
  radius = X/2*(1+0.75*cos(w*t));
  background(0); stroke(h2,s2,80);
  for(i=0;i<NUM;i++)
  {
    strokeWeight(3);
    x=delta_X*i;
    rect(X-x,X-x,2*x,2*x);
    if(x*sqrt(2)<radius){
      strokeWeight(9); rect(X-x,X-x,2*x,2*x);}
    else if(x<radius){
      strokeWeight(9);
      y=sqrt(radius*radius-x*x);
      line(X+x,X-y,X+x,X+y);
      line(X-x,X-y,X-x,X+y);
      line(X-y,X+x,X+y,X+x);
      line(X-y,X-x,X+y,X-x);     
    }
  }  
}

Beta Home
Victor Vasarely

Boglar

Canvas that uses the Processing file VV_Boglar2.pde
Code Home
Victor Vasarely

Boglar Code

Boglar: Variation on a theme by Victor Vasarely

int NUM=15; float h1, h2, t, w, p, a, q, k;
void setup() 
{
  size(600,600); frameRate(30); colorMode(HSB,360,100,100); 
  smooth(); noStroke(); h1=20; h2=240; t=0; w=0.6; 
  p=0.15; q=0; a=width/NUM; k=4*(sqrt(2)-1)/3;
}

void draw() 
{
  int i, j; t+=1/30.0;
  h1=(h1+0.11)%360; h2=(h2+0.19)%360;
  for(i=0;i<NUM;i++){
    for(j=0;j<NUM;j++){
      fill(h1+(h2-h1)*((i+j)%2), 80,
          100-100/NUM*(abs(i-NUM/2)+abs(j-NUM/2)));
      rect(i*a,j*a,a,a);
      q=k*(3+cos(0.5*t+(i+j)%2*PI))/4*(1-2*p);
      fill(h1+(h2-h1)*((i+j+1)%2), 80,
          100-100/NUM*(abs(i-NUM/2)+abs(j-NUM/2)));
      beginShape();
        vertex((i+0.5)*a, (j+p)*a);
        bezierVertex((i+0.5+q)*a, (j+p)*a, (i+1-p)*a, 
                     (j+0.5-q)*a, (i+1-p)*a, (j+0.5)*a);
        bezierVertex((i+1-p)*a, (j+0.5+q)*a, (i+0.5+q)*a, 
                     (j+1-p)*a, (i+0.5)*a, (j+1-p)*a);
        bezierVertex((i+0.5-q)*a, (j+1-p)*a, (i+p)*a, 
                     (j+0.5+q)*a, (i+p)*a, (j+.5)*a); 
         bezierVertex((i+p)*a, (j+0.5-q)*a, (i+0.5-q)*a, 
                      (j+p)*a, (i+0.5)*a, (j+p)*a);
      endShape();
    }
  }
}

Boglar Home
Victor Vasarely