Jump to content
Masoud

How can I force particles to be attracted to the surface of moving geo?

Recommended Posts

Hello;

In a particle sim, I would like particles to start to move (at a specified distance) toward an animated sphere and attach to its surface. I tried "POP Attract", "POP steer seek", "POP advect", without success!

How can I achieve this particle behavior?

 

Thanks for helping.

01.jpg

Attractor_01.hip

Edited by Masoud

Share this post


Link to post
Share on other sites

Hi "Tesan";

Honestly, I didn't get any useful things from the links you recommended :(

 

Share this post


Link to post
Share on other sites

POP Attract is unfortunately of pretty limited utility in a lot of situations.

It does have a mode to attract to specific points or parametric locations on geometry (similar to the Creep SOP). You just need to provide the goal points to attract to. Scattering a number of points onto the goal sphere equal to your number of particles and giving them an i@id attribute to match with is an easy way to do this. You'll just have to deal with carefully fine-tuning your forces, because POP Attract only modifies the v@force attribute so there will be overshoot.

If you want more control, it's not too hard to define the goal yourself in a POP Wrangle and bind it to some other attribute, such as the v@targetv wind force attribute. The VEX is pretty straightforward:

// get matching goal point by id
int match = idtopoint(1, i@id);

// get vector to goal point
vector goal = point(1, "P", match);

// set targetv (wind force) to move towards goal.
// targetv and airresist are the attributes generated by pop wind.
vector targetv = (goal - @P) * ch("force_scale");
v@targetv = targetv;
f@airresist = ch("air_resistance");

Those two attributes being bound at the end there are special attributes that the POP Wind DOP generates. The POP Solver uses these to define a target velocity and a bias for mixing with other wind forces. This lets you much more directly influence particle behavior.

I'm attaching an example of both methods.

pop_goal_methods.hiplc

  • Like 4

Share this post


Link to post
Share on other sites

Hi, Henry

The second one worked for me, very useful tips.

Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×