Daily Creative Coding

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

線によるパーリンノイズの可視化

/**
* visualization of 2d perlin noise by lines
*
* @author aa_debdeb
* @date 2016/05/30
*/

void setup(){
  size(500, 500);
  stroke(0, 255, 128, 255);
  strokeWeight(1);
}

void draw(){
  background(255);
  for(int w = -10; w < width + 10; w += 3){
    for(int h = -10; h < height + 10; h += 3){
      float wNoise = map(noise(w * 0.005, h * 0.005, frameCount * 0.05), 0, 1, -6, 6);
      float hNoise = map(noise(w * 0.03 + 100, h * 0.03 + 200, frameCount * 0.02), 0, 1, -6, 6);
      line(w, h, w + wNoise, h + hNoise);
    }
  }
}