Skip to content

Instantly share code, notes, and snippets.

@andrusenn
Last active April 25, 2019 00:02
Show Gist options
  • Save andrusenn/cee760f2be4b77178c4eb9606616f043 to your computer and use it in GitHub Desktop.
Save andrusenn/cee760f2be4b77178c4eb9606616f043 to your computer and use it in GitHub Desktop.
Perlin Noise Particles
// 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