Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
dandelany
Feb 19, 2016
Hi all - this is Vector Toy, a side project I've been working on for a couple weeks: http://dandelany.github.io/vector-toy. Inspired by the famous Nullschool Earth wind map, I wanted to implement the same style of visualization for arbitrary 2D vector field functions, and to do so in a way that allows you to experiment with the functions direct-manipulation-style in the browser. So by changing the functions in the text boxes on the left, you can generate pretty much any vector field you can think of! Hope you enjoy playing with it as much as I do :)

Some notes:

- High-quality renders can be made by setting Fade to zero, # of Particles to a high number, and Line Width to a low number.

- Add interactivity easily by using the globals `mouseX` and `mouseY` in the vector functions, which represent the mouse cursor's current X and Y coordinates in the *field's* coordinate system (not pixel coords).

- The URL contains all of your settings, so you can share what you make by using the built-in link shortener at the top. Note that these links allow execution of arbitrary JS, so be aware that links from others may crash your tab or redirect you somewhere else. Never host this code on a domain where XSRF-style attack could be a concern.

- Some challenges, for the adventurous... Try to make a human face or figure, a Starry Night styled sky, or a realistic cross section of a fruit. Then send it to me so I can include it as one of the default presets, since I failed to make them myself :)

Have fun, and please post links here if you make any cool ones! I will add the best ones to the list of presets which are showed randomly on first page load. Thanks!

-dan



dandelany fucked around with this message at 20:29 on Feb 19, 2016

Adbot
ADBOT LOVES YOU

  • Locked thread