ランダムネスを加えた円(渦巻き) [generative art]

今朝のprcessing:
ランダムネスを加えた円(渦巻き) [generative art]
fig4.4

f:id:ksumiya0318:20160929122906p:plain

seedの初期値: random in [0, 10]
パーリンノイズ(noise)を利用.

size(500, 300);
background(255);
strokeWeight(5);
smooth();

float centx  = width/2;
float centy  = height/2;
float radius = 100;

stroke(0, 30);
noFill();
ellipse(centx, centy, 2*radius, 2*radius);

stroke(0);
float angmin =     0;
float angmax = 4*360;
float x, y;
float xold = 0;
float yold = 0;
float seed = random(10);
float noiseCoe = 100;

radius = 10;
for (float ang = angmin; ang <= angmax; ang += 5) {
  seed   += 0.05;
  radius += 0.5;
  float thisRadius = radius + noiseCoe * (2 * noise(seed) - 1);
  float rad = radians(ang);
  x = centx + thisRadius*cos(rad);
  y = centy + thisRadius*sin(rad);
  
  if (ang != angmin) {
    line(x, y, xold, yold);
  }
  xold = x;
  yold = y;
}

saveFrame("img.png");

寝るとやっぱりスッキリする.