Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  fluid collisions
#6
(24-05-2022, 02:53 PM)sinannsekerr Wrote: Can you send me a script example, about 2 fluid collision debug?  Really need help about it, i am stuck.

Hi!

As I just explained in the previous message, fluids do not collide with each other. There's no such thing as "fluid collision debug". There's only one way to indirectly determine if fluid particles are within interaction range, and that's using diffusion.

(24-05-2022, 02:53 PM)sinannsekerr Wrote: I have 1 solver and 2 emitter in it.
Need to know when 2 emitter meet...

There's no out-of-the-box way to know this in Obi. Each individual fluid particle interacts with many particles around it (often +50), but it doesn't care what emitters they belong to since each particle carries its own data. You need to figure out a different approach to this.

Let's assume your fluid is conceptualized into "drops", and you want to know when two drops merge with each other. First, you need to be able to identify individual drops in the fluid and roughly determine their position and radius. To do this you can analyze particle positions, which you can retrieve using the particle API: http://obi.virtualmethodstudio.com/manua...icles.html

One way to do this is using a greedy island-building algorithm:
- Initially, each particle belongs to its own "drop" with radius == the radius of the particle, and position == the position of the particle.
- Iterate trough all particles: for each one, get particles close to the drop they belong to, then merge them into a single drop updating the drop's position to be the average of all the particles in it, and the radius to be the maximum distance from any particle in the drop to the drop's center.
- Once you're done iterating trough all particles, the result is a list of all drops: about each drop you know its position, its radius, and the list of particles in it.

If you keep a list of all drops over a few frames, you can identify drops that have merged or drops that have split into multiple smaller drops, which is what you are looking for I believe.
Reply


Messages In This Thread
fluid collisions - by sinannsekerr - 24-05-2022, 07:23 AM
RE: fluid collisions - by josemendez - 24-05-2022, 08:39 AM
RE: fluid collisions - by sinannsekerr - 24-05-2022, 09:08 AM
RE: fluid collisions - by josemendez - 24-05-2022, 09:17 AM
RE: fluid collisions - by sinannsekerr - 24-05-2022, 02:53 PM
RE: fluid collisions - by josemendez - 25-05-2022, 07:45 AM
RE: fluid collisions - by sinannsekerr - 25-05-2022, 01:10 PM