q5play
    Preparing search index...

    Function noise

    • 🧮 Generates a noise value based on the x, y, and z inputs.

      Uses Perlin Noise by default.

      Parameters

      • Optionalx: number

        x-coordinate input

      • Optionaly: number

        y-coordinate input

      • Optionalz: number

        z-coordinate input

      Returns number

      a noise value

      q5.draw = function () {
      background(0.8);
      let n = noise(frameCount * 0.01);
      circle(0, 0, n * 200);
      };
      q5.draw = function () {
      background(0.8);
      let t = (frameCount + mouseX) * 0.02;
      for (let x = -5; x < 220; x += 10) {
      let n = noise(t, x * 0.1);
      circle(x - 100, 0, n * 40);
      }
      };
      q5.draw = function () {
      noStroke();
      let t = millis() * 0.002;
      for (let x = -100; x < 100; x += 5) {
      for (let y = -100; y < 100; y += 5) {
      fill(noise(t, (mouseX + x) * 0.05, y * 0.05));
      square(x, y, 5);
      }
      }
      };