generative art l1_1

generative art

list1_1

generative artの勉強を始めた.

[普及版]ジェネラティブ・アート―Processingによる実践ガイド

[普及版]ジェネラティブ・アート―Processingによる実践ガイド

  • 作者: マット・ピアソン,Matt Pearson,久保田晃弘,沖啓介
  • 出版社/メーカー: ビー・エヌ・エヌ新社
  • 発売日: 2014/11/21
  • メディア: 単行本(ソフトカバー)
  • この商品を含むブログ (1件) を見る

void setup() {
 size(2000, 2000, P3D);
 background(150);
 stroke(0,50);
 fill(255, 200);
 float xstart = random(10);
 float ynoise = random(10);
 translate(width/2, height/2, 0);
 for (float y = -(height/8); y <= (height/8); y+=3) {
   ynoise += 0.02;
   float xnoise = xstart;
   for (float x = -(width/8); x <= (width/8); x+=3) {
     xnoise += 0.02;
     drawPoint(x, y, noise(xnoise, ynoise));
   }
 }
}

void drawPoint(float x, float y, float noiseFactor) {
  pushMatrix();
  translate(x * noiseFactor * 4, y* noiseFactor * 4, -y);
  float edgeSize = noiseFactor* 26;
  ellipse(0, 0, edgeSize, edgeSize);
  popMatrix();
}

output:
f:id:ksumiya0318:20160920021933p:plain

初めてのgenerative art.
まだ写経しただけ. あとで内容を読みとく.
早く先を読みたい.