xxxxxxxxxx
36
/*
* Demonstrating motion in Perlin noise
*
* Kind of looks like the values are creating a wave,
* but actually the values are just moving along the canvas
*
* If you increase the speed at which tStart incremenets to 0.05 or more, you will see hte sideways * motion more clearly
*/
let t;
let 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 += 0.1;
}
tStart+=0.003;
}