Inherit mass from colliding particle

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Inherit mass from colliding particle

Post by Pancho » 30 Oct 2012, 17:04

I managed to get it started. And it seems to work. Kind of. Suddenly the mass of the surviving particle rockets into the air. I have no clue whether this is due to the way particles work and my approach is wrong or if there is a bug or something else.

In short: I use closest particle to determine which particles might collide. I then calc the distance between them and compare them to the size of both (added). If the distance is smaller than the sum of the sizes they collide. I then get the mass of the colliding particles and add it to the particle with the heigher kinetic energy, deleting the "weaker" particle. Sometimes it works, but then the size of the particles go through the roof.

The size is calculated by the volume. In this case volume = mass as it is supposed to be water. No idea what's wrong. I changed to maximum iterations of the state machine and the subframe sampling. The effect is still there. Very anoying.

If somebody could take a look I'd be happy as I'm stuck for now.

Cheers!!!



https://www.dropbox.com/s/edmct7efy0zrdfv/rain_0051.zip

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Inherit mass from colliding particle

Post by Pancho » 30 Oct 2012, 23:02

Re-checked everything. No idea.

The only thing which comes to my mind is the way a particle animation is simulated. If the particles don't get deleted properly or the mass gets added over and over because of some loop. Otherwise there's no explanation for the rapidly growing particles. Very strange!

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Inherit mass from colliding particle

Post by Pancho » 31 Oct 2012, 08:28

Did anybody manage to take a look? Just installed dropbox, so I don't know if anybody else is able to download the scene.

Cheers!

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Inherit mass from colliding particle

Post by Pancho » 31 Oct 2012, 10:38

Found it myself. The epsilon value in a "greather than or equal to" node was not zero, but 0.0001. This way two colliding particles could get into the state of being the survivor, adding their masses over and over again without getting deleted. Tricky stuff to find.

Thanks to those who might have taken a look!

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Inherit mass from colliding particle

Post by Pancho » 31 Oct 2012, 15:28

O.k.,

this has been a larger problem then I would have expected.

Can somebody please confirm:

I think even if I deleted the "weaker" particle by "delete point", it still evaluates till the end of the frame. Especially with subframeSampling. So even if it shouldn't be there anymore, it is. To avoid re-evaluation of this particle I came up with a "deleted" attribute which by the use of several "if" nodes prevents this particle to cause problems. Is this something common one needs to take care of in ICE?

Cheers!

User avatar
TwinSnakes007
Posts: 316
Joined: 06 Jun 2011, 14:00

Re: Inherit mass from colliding particle

Post by TwinSnakes007 » 31 Oct 2012, 15:38

Hmm...how about setting the "weaker" particles mass to [0] as well as deleting it. That way, it wont contribute to the growing mass, and it will be deleted at the end of the frame.

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Inherit mass from colliding particle

Post by Pancho » 31 Oct 2012, 16:57

O.k.,

it works (kind of). What I still see from time to time are drops which seem to accelerate (without a cause) and drops which seem to loose volume. Bit weird.

If anybody would like to post their 5 cents, I'd be glad to get some feedback.

Cheers




https://www.dropbox.com/s/z2ciotot5aj4zy2/rain_0069.zip

User avatar
TwinSnakes007
Posts: 316
Joined: 06 Jun 2011, 14:00

Re: Inherit mass from colliding particle

Post by TwinSnakes007 » 31 Oct 2012, 17:09

Pancho wrote:What I still see from time to time are drops which seem to accelerate (without a cause) and drops which seem to loose volume. Bit weird.
Are you taking care to clamp your Mass attribute, since your calculating it? It probably should never be a negative value.

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Inherit mass from colliding particle

Post by Pancho » 31 Oct 2012, 18:16

Actually the mass doesn't get calculated. Only the size. The mass only gets added. self.mass + self.collisionMass. For water mass and volume are the same, at least if it comes to the pure numbers. The size (radius) gets calculated by the volume of a sphere, necessary to hold the amount of liquid.

Can anybody give me a hint about the subframe sampling and how it affects stuff like delete point? Is the a difference whether I plugin my compounds into the state node or the slide node (execute while sliding)? Would love to be able to tell where the error came from to avoid it in the future.

But thanks for the guess!