
Simulating blobs of fluid - peeke
https://peeke.nl/simulating-blobs-of-fluid
======
jastanton
This was really satisfying to demo on the bus. I held my phone up as still as
I could and when the bus lurched forward or made an abrupt stop the fluid
responded accordingly. Something about it was just beautiful. Tech imitating
nature. The illusion held pretty well too. Good job Google/Apple for making
good sensor data and this algorithm uses it well. Great job!

------
robin_reala
Aside, but as peeke’s here: your articles are great. Any chance you could add
an RSS feed so I can follow easily?

~~~
peeke
I'll have a look over the weekend!

------
gdubs
Meta point but I really like the design, typography, and color of the whole
post. Nice work!

------
alexfringes
Fantastic read! Not to diminish the original contribution here, but I got
curious and started looking for similar projects on the native (in my case iOS
/ Metal) side that aren't part of the usual suspects like game engines.

These two are kind of fun to play with:
[https://github.com/andreipitis/FluidDynamicsMetal](https://github.com/andreipitis/FluidDynamicsMetal)
[https://github.com/hagmas/MobileFluidSimulation](https://github.com/hagmas/MobileFluidSimulation)

Both based on this approach, detailed here by Nvidia:
[http://developer.download.nvidia.com/books/HTML/gpugems/gpug...](http://developer.download.nvidia.com/books/HTML/gpugems/gpugems_ch38.html)

The technique this is based on doesn't create those satisfying tension effects
but is more similar to paint flowing on a surface of water, so from a
tangibility perspective I'd still love to find something closer to this post's
work that runs natively.

~~~
peeke
You might find this post by Jamie Wong interesting: [http://jamie-
wong.com/2016/08/05/webgl-fluid-simulation/](http://jamie-
wong.com/2016/08/05/webgl-fluid-simulation/)

Doesn't seem to work on mobile though

------
buildlove
Super interesting article -- it broke down the steps of the simulation
algorithm very clearly and the code samples supplemented the theoretical
explanation well. I've been learning D3.js recently (working with force-
directed graph simulations) and this reinforces a lot of the concepts I've
encountered in learning graph simulations with D3.

------
learnstats2
Did I miss a demo? I would have got more from this explanation if it also
showed what it was talking about.

~~~
rhema
Yep, you missed it. It's at the top of the page / header.

~~~
learnstats2
Ah, thank you. It doesn't display in my browser.

------
huebomont
The scroll response is backward, but otherwise very cool! When I scroll down,
the ball goes up the screen, but the liquid goes up as well, whereas in real
life it would be compressed towards the bottom of the ball.

------
Marioheld
Very nice demo but it seems that the gyroscope data from my phone is
interpreted wrong. When I hold my phone with a left tilt the fluid flows to
the right. Using iPhone XS with iOS 12.1.3

------
tastyfreeze
I was pleasantly surprised that scrolling made the fluid react to the motion.
Very nice work both in writing and demonstration.

------
dekhn
very clear read; wish I had this when I was learning molecular dynamics.
However, I suggest using bouncing term on the walls rather than sticking.

~~~
amelius
> wish I had this when I was learning molecular dynamics

Keep in mind, though, that the article only outlines a way to make fluid drops
_look_ realistic, and doesn't actually guarantee anything about whether the
behavior _is_ realistic.

~~~
peeke
Jep, lot of shortcuts to make it run at 60 fps. It's most likely not very
scientifically accurate.

