Fluid simulation
Drag your mouse across the canvas to see the magic!
I tried to port the code from a Coding Train tutorial to P5 myself. I didn't have to, there was already an example sketch present, but I figured it was a good way to learn.
I eventually managed to get everything working, which wasn't easy, especially since there were no clear errors at first and the function console.log()
is a real performance bottleneck...
I added both horizontal and vertical scaling, so I could render the sketch better on this website. The original sketch has their scales turned back into a square.
Now that I have some general idea of what is actually happening I'm thinking about rewriting the whole thing again to use Vectors instead. But we'll see.