generative_noise02

float xstart, xnoise, ystart, ynoise;

void setup() {
  size(500, 500);
  colorMode(HSB, 360, 100, 100);
  smooth();
  background(0, 0, 100);
  frameRate(24);

  mousePressed();
}

void draw() {
  background(0, 0, 0);

  xstart += 0.01;
  ystart += 0.01;

  xnoise = xstart;
  ynoise = ystart;

  for (int y = 0; y <= height; y +=5) {
    ynoise += 0.1;
    xnoise += xstart;
    for (int x = 0; x <= width; x += 5) {
      xnoise += 0.1;
      drawPoint(x, y, noise(xnoise, ynoise));
    }
  }
}

void drawPoint(float x, float y, float noiseFactor) {
  pushMatrix();
  translate(x, y);
  rotate(noiseFactor * radians(540));
  noStroke();
  float edgeSize = noiseFactor*35;
  float grey = 150 + (noiseFactor*120);
  float alph = 150 + (noiseFactor*120);
  fill((xstart+ystart)*15, frameCount%100, grey, alph);
  ellipse(0, 0, edgeSize, edgeSize/2);
  popMatrix();
}

void mousePressed() {
  xstart = random(10);
  ystart = random(10);
}

今日も写経の時間.昨日の宿題はまた後日.写経したのち,mousePressedを入れて,クリックするたびにあたらしいパターンになるようにして,色をつけた.今は写経の時間.写経しながら,復習と次のことを考える.