PDA

View Full Version : Making particles avoid inter collision with expressions


bjuren
05-23-2008, 03:04 PM
Hi.

Ive created a particle crowd system where the instenced particles flows along a surface using the GoalU, GoalV. The speed of the particles is randomized and therefor makes them run through each other.

So my problem is... Since the GoalU,V seams to override all fields. I need to write an expression. How can I determine a particles position and compare it to all the other particles to see if they are too close. And if they are change either the speed or direction of that particle.

Thanks to anyone who can help me out!

Kristian
vfx artist
Sweden

rxgeez
05-25-2008, 09:55 PM
Ive done something similar to this using a radial field on each particle but instead of relying on the field to try to push them away I instead get the input force of each particle acting on every other particle and based on the vector of that force I animate the goalU and goalV to move away from each other.....if this makes any sense.

I posted a file in a different post that you can take a look at that shows what im talking about. It's not perfect but it does a pretty good job keeping each particle away from each other based on the radial fields maxDistance.

http://forums.cgsociety.org/showthread.php?f=86&t=608076

Hope this helps.

-k

bjuren
05-26-2008, 10:18 AM
Thanks for your suggestion. Will try your aproach.. I think thats exactly what I need. Just one more question.. How can you determine which field is in what position in the field array if you are using more than one field?

cheers!
Kristian

bjuren
05-26-2008, 12:57 PM
I managed to extract the radial force and got everything to work nicely!!
Thanks a lot!

Kristian

CGTalk Moderation
05-26-2008, 12:57 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.