radius_lines03

int centx;
int centy;
float x, y;

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

  int centx = 0;
  int centy = 0;
}

void draw() {
  noStroke();
  fill(0, 0, 100, 20);
  rect(0, 0, width, height);
  translate(random(width), random(height));
  
  for (int i = 0; i < 100; i ++) {
    float lastx = -999;
    float lasty = -999;
    float radiusNoise = random(10);
    float radius = 10;

    stroke(frameCount%360, random(50), random(70, 100)); 

    int startangle = int(random(360));
    int endangle = 1440 + int(random(1440));
    int anglestep = 5 + int(random(3));

    for (float ang = startangle; ang <= endangle; ang += anglestep) {
      radiusNoise += 0.05;
      radius += 0.5;

      float thisRadius = radius + (noise(radiusNoise) * 200) - 100;
      float rad = radians(ang);

      x = centx + (radius * cos(rad));
      y = centy + (radius * sin(rad));

      if ( lastx > -999) {
        line(x, y, lastx, lasty);
      }
      lastx = x;
      lasty = y;
    }
  }
}

昨日書いた radius_lines02 をtranslateを使って動かしてみた.translateを入れる位置によって,できあがるイメージがだいぶ異なるのがおもしろかった.