Capella

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

Capella Code

Capella: Variation on a theme by Victor Vasarely

float cX, cY, r, y, deltaY, orig, om, t, sp, h;

void setup() 
{
  size(600,600); smooth(); colorMode(HSB,360,100,100);
  frameRate(30); cX=width/2; cY=height/2; sp=width/14.0; 
  om=5; t=0; h=0;
}

void draw() 
{
  t+=1/30.0; orig = om*(1+cos(0.2*t))/2;
  deltaY=2*orig; background(255); fill(0);
  h=(h+0.1)%360;
  for(y=-cY; y<cY; y=y+sp){
    stroke(0); fill(h,75,100-70*(cY+y)/height);
    rect(0,cY+y,width,sp);
    noStroke(); fill(0);
    rect(0,cY+y-deltaY/4,width,deltaY/2);}

  for(r=6.5*sp; r>sp; r-=sp){
    for(y=-cY; y<cY; y=y+sp){
     if(abs(y)+om<r){
       beginShape();
       vertex(cX+sqrt(pow(r,2)-pow(y-deltaY,2)),cY+y-deltaY);
       vertex(cX+sqrt(pow(r,2)-pow(y,2)),cY+y);
       vertex(cX+sqrt(pow(r,2)-pow(y+deltaY,2)),cY+y+deltaY);
       vertex(cX-sqrt(pow(r,2)-pow(y+deltaY,2)),cY+y+deltaY);
       vertex(cX-sqrt(pow(r,2)-pow(y,2)), cY+y);
       vertex(cX-sqrt(pow(r,2)-pow(y-deltaY,2)),cY+y-deltaY);
     endShape(CLOSE);}
    }
    deltaY+=orig;
  }
}

Capella Home
Victor Vasarely

CTA

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

CTA Code

CTA: Variation on a theme by Victor Vasarely

int Hue, Saturation, i, j, n, NUM=20;
int Square;

void setup()
{
  size(600,600); frameRate(30); smooth(); 
  noStroke(); colorMode(HSB,360,100,100); 
  n=NUM*NUM; Hue=0; Square=width/NUM;
}

void draw()
{  
  if(n==NUM*NUM){
    n=-1; Hue=(Hue+29)%360;
    Saturation=(int)random(25,100);
    background(Hue,Saturation,50);}  
  i=n%NUM; j=int(n/NUM);
  fill(Hue,Saturation,
     100-200/NUM*max(abs(i-(NUM-1)/2.0),abs(j-(NUM-1)/2.0)));
  ellipse(Square*(0.5+i),Square*(0.5+j),
          Square,Square);
  n++;

CTA Home
Victor Vasarely