Friday, 25 May 2018

Simple processing Generative Art/Drawing 4

 




Below is the code to generate the above shown drawing..

float r=0;

void setup() {
  size(400, 400);
  background(0);
  smooth();
  noStroke();
}

void draw() {
  
  if (r>300) {     // To reset the drawing
    fill(0);
    r=0;
    rect(0, 0, width, height);
  }
  rotate(r);
  translate(width/2, height/2); //to bring it to center
  fill(0, random(r, 255), random(r, 255));
  float circle_size= random(5, 15);
  ellipse(100+r, 10, circle_size, circle_size);
  r=r+0.2;
}

No comments:

Post a Comment