Wednesday, June 30, 2010

Psychedelic Circles

// 1: draw the outer circle
// 2: draw n-1 concentric circles 

int randRed, randGreen, randBlue;
//int randSeed = int(50);
void setup(){
  size(800, 500);
  noFill();
  //frameRate(60);
  //noLoop();
}

void draw(){
  
  
  //background(255);
  drawConcentricCircles(400, 250, 1500, 10);
}

void drawOneCircle( int x, int y, int r){
  smooth();
  noStroke();
  
 if(random(1)<0.5) {
          fill(0);
          } else {
          fill(255);
          }       
ellipse(x, y, r, r);
}

void drawConcentricCircles(int x, int y, int r, int steps){

  if(r > steps + 1){
    
    drawOneCircle(x,y,r);
    drawConcentricCircles(x,y, r-steps, steps);
  }
  
}

info info

submitted by: ric_lmc
views: 35


Tags:

comments comment

loading loading...

 

Add a comment: