0

I am playing with a real-time particle system in openframeworks for an art installation.

My visual goal is something like a fluid surface. The whole screen is filled with slowly moving particles and between specific points should be slow streams of flowing particles, which can increase in density. (Like very slowly stirring in the milk in a cup of coffee...) It doesn't have to be accurate, only should look good, with about 50,000-100,000 particles, running on a decent mac.

Currently, I have a simple physics-based particle system based on this: ParticleVec3 on github The particles have a mass, velocity etc. and forces can mathematically be applied to them.

My first approach is to implement a tension between near particles, so that other particles will be dragged behind a moving one.

The second idea is to limit the range of a force, for that, I have to know which particles are located around the point where the force should be applied.

Do you have any tips or a common algorithm to solve this problem?

Do you think I should refine one of my approaches? For that, I probably have to find a low-performance way to find surrounding particles..

matthiaswitt
  • 196
  • 9
  • You mean [this](https://stackoverflow.com/questions/6698484/using-a-quadtree-to-get-all-points-within-a-bounding-circle)? – meowgoesthedog Jun 08 '18 at 22:05
  • That would help – matthiaswitt Jun 11 '18 at 08:44
  • That makes me think of a [Boid](https://en.wikipedia.org/wiki/Boids) simulation. It is not made to simulate a fluid but you could try tweaking the parameters. There seems to be at least [one](http://s373.net/code/boids/) openframeworks implementation. – Gabriel Devillers Jun 20 '18 at 16:09

0 Answers0