C++ openFrameworks addon for solving and drawing 2D fluid systems based on Navier-Stokes equations and Jos Stam's paper "Real-Time Fluid Dynamics for Games" http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/GDC03.pdf
Demo at www.memo.tv/msafluid/
Other useful resources and implementations I looked at while building this library:
- Mike Ash (C), http://mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html
- Alexander McKenzie (Java), http://www.multires.caltech.edu/teaching/demos/java/stablefluids.htm
- Pierluigi Pesenti (AS3 port of Alexander's), http://blog.oaxoa.com/2008/01/21/actionscript-3-fluids-simulation/
- Gustav Taxen (C), http://www.nada.kth.se/~gustavt/fluids/
- Dave Wallin (C++), http://nuigroup.com/touchlib/ (uses portions from Gustav's)
The code in this repository is available under the MIT License.
Copyright (c) 2008-2012 Memo Akten, www.memo.tv
The Mega Super Awesome Visuals Company
Copy to your openFrameworks/addons folder.
- MSACore
openFrameworks 0072
I am generally testing only with openFrameworks, however it should work with Cinder too. If it doesn't, please file an issue.
Probably will not work with Cinder without some (minor) changes
- compatible with OF0072
- renamed (uppercase) MSA namespace to (lowercase) msa. (kept MSA as an alias for backwards compatibility)
- all classes are now inside a new namespace 'msa::fluid::'
- move to centralized MSALibs (requires MSACore)
- everything is msa:: namespace
- u[] and v[] condensed to (Vec2f uv[])
- r[], g[], b[] condensed to (Vec3f color[])
- unified API for getting and setting info:
- all vel & colors set and get with the structs
- all getters and setters have 3 functions, index, (i, j), Vec2f pos
- unified API with processing.org version
- solver u, v, r, g, b arrays now public
- drawer can incDrawMode and decDrawMode
- loads of optimizations by Maa (http://www.lagraine.com/ - new content coming soon)
- changed license to revised BSD (a lot more more permissive than GPL)
- added RGB or monochrome functionality (enableRGB())
- vector drawing implemented
- get and set info much improved
- added draw mode system
- setup() now only takes dimensions, other parameters have their own setters
- initial version