Show HN: Vector Toy – Visualize and manipulate vector field functions
dandelany.github.io
dandelany.github.io
- The code is available on Github [2], bugs/feature requests/PRs welcome.
- 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 :)
[1] http://earth.nullschool.net/ [2] https://github.com/dandelany/vector-toy
https://dandelany.github.io/vector-toy/?s=eyJpc1BvbGFyIjpmYW...