-
-
Save mcanthony/ba09a12a780ed685ba43a045111eeb57 to your computer and use it in GitHub Desktop.
Revisions
-
mattdesl created this gist
Apr 9, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ render for each particle x, y = particle.position color = sample( colorMap, x, y ) noise = sample( noiseMap, x, y ) angle = noise * PI * 2 particle.velocity.add( cos(angle), sin(angle) ) particle.velocity.normalize() drawParticle( particle, color ) #a crude way of killing off particles ... particle.life -= drain if (particle.life < 0) particle.life = 1 particle.resetPosition()