Last active
April 25, 2019 00:02
-
-
Save andrusenn/cee760f2be4b77178c4eb9606616f043 to your computer and use it in GitHub Desktop.
Perlin Noise Particles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// loop: ------------------------------- | |
fade(10) | |
// displace(-1,0) | |
stroke(255, 80) | |
beginShape(POINTS) | |
$npsys.update((x, y) => { | |
if (dist(x, y, width / 2, height / 2) < 300 && x < width / 2) vertex(x, y) | |
}).nSize(0.01).aVel(osc() * 5).nVel(5) | |
endShape() | |
if (pulse(520)) { | |
bg(0) | |
$npsys.resetDir() | |
} | |
mirrorY() | |
// aux: ---------------------------------- | |
snip('noise', () => { | |
$npsys = new NPSys() | |
for (let i = 0; i < 8000; i++) { | |
$npsys.addObj(new NP(random(width), random(height))) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment