Daily Creative Coding

元「30 min. Processing」。毎日、Creative Codingします。

blurを繰り返しかける

/**
* blur blur blur
*
* @author aa_debdeb
* @date 2016/02/27
*/

void setup(){
  size(500, 500);
  frameRate(30);
}

void initialize(){
  background(random(255), random(255), random(255));
  stroke(random(255), random(255), random(255));
  strokeWeight(5);
  fill(random(255), random(255), random(255));
  for(int i = 0; i < 50; i++){
    float w = map(pow(random(1), 2), 0, 1, 20, 100);
    rect(random(width - w), random(height - w), w, w);
  } 
}

void draw(){
  if(frameCount % 200 == 1){
    initialize();
  }
  filter(BLUR);
}