Skip to content

Instantly share code, notes, and snippets.

@TheMapSmith
Created October 18, 2019 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheMapSmith/aad210d07e4d4699b07d41be7364a0a2 to your computer and use it in GitHub Desktop.
Save TheMapSmith/aad210d07e4d4699b07d41be7364a0a2 to your computer and use it in GitHub Desktop.

Particle Generation Idea

Is this right?

  1. Establish a buncha particles
  • Gridded? Random?
  1. Pass the start XY through a noise = random.noise2D(sx, sy) to get a value
  • What to do with Frequency?
  • What to do with Amplitude?
  • Returns range (-1, 1)?
  1. Calculate next XY via:
var x = r * Math.cos(noise);
var y = r * Math.sin(noise);
  1. Line-to between the points:
context.moveTo(sx,sy)
context.lineTo(x,y)
  1. Profit?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment