View Full Version : nParticles - Stickiness PP?

10 October 2009, 04:23 PM
Does anyone know if it is possible to set the Stickiness on a per particle basis with nParticles?

10 October 2009, 10:15 PM
You can't set it on a per particle basis yet, but you can paint stickiness per vertex or with a map on a colliding mesh (nRigid) or an nCloth.


10 October 2009, 11:46 PM
Thanks Duncan,

I was trying to figure out how to do a large group of arrows shooting at a wall but only have some of the arrows stick while the others bounce off. I thought I would be able to randomize the stickiness but I guess not.

I ended up doing this

if (particleShape1.particleId % 5 != 0)

along with the methods described in other threads to store the position based on a collision event and it seems to work.

10 October 2009, 06:09 PM
You could randomize the stickiness on the colliding object to accomplish the same goal. Stickiness is like friction in that it uses the average of value for the two colliding objects. A value of 2 on one object guarantees it will stick while a value of 1 on one object requires that it be 1 on the other object for the same effect.

You could make stickiness= 2.0 on the colliding object and then map the stickiness( the map multiplies the base value). Where the texture is white particles will stick and where it is black they will bounce off. Set the particle stickiness to 0.0 so that zero values on the map will not stick.

edit- One caveat is that the texture is sampled at the mesh vertices and the result of that used for the collisions, so the mesh should have enough resolution to resolve your texture.


10 October 2009, 07:22 PM
Two particle shapes would also work, one sticky, one not.

10 October 2009, 02:06 AM
Two particle shapes would also work, one sticky, one not.
I second that. More managable that way aswell.

10 October 2009, 02:12 PM
Yeah, I guess using 2 particle shapes would work. But before you mentioned that I had already come up with the a different solution. And this was just a learning exercise to introduce myself to MEL so I guess it was successful in that way. However, I am new to MEL and I would appreciate any insight you guys might have for me. My goal was to duplicate the results of Brandon Riza's R and D arrow flocking. Which you can watch here:

I have attached what I came up with. I would appreciate it if someone could take a look at it and point out how I might be able to do things better. For example, the rotation of the arrows after they bounce is driven by sin/cos of time plugged into the aim direction. But it doesnt maintain a constant axis while spinning because I wasn't able to find a way to give every particle its own axis. I tried using sphrand() to pick a random vector to use as the up axis but each arrows still ended up using the same axis.

So basically, how would you guys accomplish this and how could I improve mine?

CGTalk Moderation
10 October 2009, 02:12 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.