xxxxxxxxxx
34
/*
* Demonstrates how incrementing t by higher or lower values
* creates smoother or less smooth curves in Perlin noise
*
* You're just moving through the noise graph slower or faster
*
* mouseX controls the increment value
*/
var t;
var tStart;
function setup() {
createCanvas(800, 600);
colorMode(HSB, 360, 100, 100);
background(0,0,0);
noiseSeed(100);
tStart = random(0,100);
}
function draw() {
background(0,0,0);
noStroke();
t = tStart;
for (let i=0; i < width/5; i++){
let y = noise(t)*height;
ellipse(i*5, y, 5);
t += map(mouseX, 0, width, 0.001, 0.1);
}
}