My attempt to create fluid simulation using p5.js instead of processing.
This code has a bug somewhere, and I could not find it. It looks like the liquid leaks somewhere from the bottom of the canvas. Probably the boundaries are not defined correctly. May be the error was made during translation from Processing to JavaScript. Anyway, it is what it is. At least it show a minor signs of life.
Inspired by Coding Challenge #132: Fluid simulation by Daniel Shiffman ("The Coding Train")
See also:
- Real-Time Fluid Dynamics for Games by Jos Stam