Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Get separate particles parts
#1
Hi!

How can you determine that in one emitter the particles are divided into several separate parts. And is it possible to obtain these groups of individual particles?

Regards!
Reply
#2
(Yesterday, 01:39 PM)Zavhoz Wrote: Hi!

How can you determine that in one emitter the particles are divided into several separate parts. And is it possible to obtain these groups of individual particles?

Regards!

Hi,

What do you mean? particles are not divisible, each particle remains a single entity throughout the simulation.

If you are referring to drops or blob-like formations, these emerge automatically from physical laws. There's no explicit tracking of those in Obi (or any existing fluid simulation engine that I'm aware of), pressure, viscosity and surface tension regulate how much the fluid tends to form drops. However there's no "list" of drops/blobs that you could access anywhere in the code, since the simulation does not need it for any purpose.

If you want to get a list of drops/blobs/isolated particles for gameplay reasons, you'll need to first determine what you consider to be a "drop" in your game, then create this list yourself.

kind regards,
Reply
#3
(Yesterday, 01:46 PM)josemendez Wrote: Hi,

What do you mean? particles are not divisible, each particle remains a single entity throughout the simulation.

If you are referring to drops or blob-like formations, these emerge automatically from physical laws. There's no explicit tracking of those in Obi (or any existing fluid simulation engine that I'm aware of), pressure, viscosity and surface tension regulate how much the fluid tends to form drops. However there's no "list" of drops/blobs that you could access anywhere in the code, since the simulation does not need it for any purpose.

If you want to get a list of drops/blobs/isolated particles for gameplay reasons, you'll need to first determine what you consider to be a "drop" in your game, then create this list yourself.

kind regards,

I understand that all particles remain one with the emitter that produced them. But I wanted to know if I can determine the particles of the compound at the moment, or if there are separate formations, as in the picture

   
Reply
#4
(11 hours ago)Zavhoz Wrote: I understand that all particles remain one with the emitter that produced them. But I wanted to know if I can determine the particles of the compound at the moment, or if there are separate formations, as in the picture

Hi Zavhoz,

There's no built-in way to do this. The engine doesn't work in terms of "formations", these emerge automatically from the simulation and are not explicitly tracked. You'll have to find these yourself.

A simple algorithm that comes to mind is to keep a set of "formations", and initially assign each particle no formation. Iterate trough all particles, for each one find its neighbors and:

- If the neighbor is not part of any formation, add it to the current particle's formation - if any. If neither are part of a formation, create a new formation and assign them both to it.
- If the current particle and its neighbor are part of different formations, merge both formations.

This is similar to the algorithm used to count connected components in a graph. Once you're done iterating trough all particles, your set will contain the individual formations you're looking for.

kind regards
Reply
#5
(7 hours ago)josemendez Wrote: Hi Zavhoz,

There's no built-in way to do this. The engine doesn't work in terms of "formations", these emerge automatically from the simulation and are not explicitly tracked. You'll have to find these yourself.

A simple algorithm that comes to mind is to keep a set of "formations", and initially assign each particle no formation. Iterate trough all particles, for each one find its neighbors and:

- If the neighbor is not part of any formation, add it to the current particle's formation - if any. If neither are part of a formation, create a new formation and assign them both to it.
- If the current particle and its neighbor are part of different formations, merge both formations.

This is similar to the algorithm used to count connected components in a graph. Once you're done iterating trough all particles, your set will contain the individual formations you're looking for.

kind regards

I heard you, thanks for the quick reply.

Sorry for my English.
Reply