xxxxxxxxxx
33
// improved version with the help of a comment by emily bjork
// Daniel Shiffman
// https://thecodingtrain.com/CodingChallenges/024-perlinnoiseflowfield.html
var inc = 0.1;
var scl = 10;
var zoff = 0;
var fr;
var particles = [];
function setup() {
fr = createP('');
createCanvas(windowWidth, windowHeight);
for (var i = 0; i < 1000; i++) {
particles[i] = new Particle();
}
background(51);
}
function draw() {
zoff += 0.003;
for (var i = 0; i < particles.length; i++) {
particles[i].follow();
particles[i].update();
particles[i].edges();
particles[i].show();
}
fr.html(floor(frameRate()));
}