fractalkitty looking for math? fractalkitty.com

all

smeared quantization

#noise#random#trig#interactive#animation#accumulates#tiling#genuary

let w, d,w2;
let t = 0;
function setup() {
  w = min(windowWidth, windowHeight,800) * 0.95;
  createCanvas(w,w);
  describe("");
  d = random(4, 10);
  s1 = abs(randomGaussian(0.001,0.005));
  noStroke();
  n1 = random(1.5, 2);
  p1 = random(2, 2.5);
  w2 =max(width,height)
  describe("pinks, reds, and oranges are smeared through rotation over time where a radial-like noise is generated through color and a circle is drawn with a color difference in the center. ")
  
}

function draw() {
  translate(width / 2, height / 2);
  t += 0.005;
  s = s1-0.005*abs(cos(t/500))
  rotate(t /4);
  n = n1 + 0.5 * sin(t / 10);
  p = p1 + 0.5 * sin(t / 10);
  for (let i = -w2 / 1.9; i < w2 / 1.9; i += d) {
    for (let j = -w2 / 1.9; j < w2 / 1.9; j += d) {
      di = dist(i, j, 0, 0);
      noisey = noise(
        sin(i / p + t - di) * cos(j * n - p) * s * i,
        sin(j / p + t - di) * sin(i * n - p) * s * j
      );

      if (di < w / 3) {
        fill(
          50 + noisey * 205 - 50 * sin(s+j / 1000 - i / 1000),
          20 + noisey * 205 - 30 * sin(s+i / 500 - j / 1500),
          50+noisey * 205 - 30 * sin(s+j / 1000 + i / 1000),5
        );
      } else {
        fill(
          noisey * 205 - 50 * cos(di / 100 + j / 1000 - i / 1000),
          noisey * 205 - 30 * cos(di / 100 + i / 500 - j / 1500),
          noisey * 205 - 30 * cos(di / 100 + j / 1000 + i / 1000),5
        );
      }
      rect(i, j, d);
      circle(i,j,d/2)
    }
  }
}

function mousePressed() {
  setup();
  draw();
  return false;
}
function touchStarted() {
  if (mouseY < 0 || mouseY > height || mouseX < 0 || mouseX > width) {
    return true; 
  }
  setup();
  draw();
  
  return false;
}

function keyPressed() {
  if (keyCode === 83) {
    save(cnv, "tile", "jpg");
  }
}