Jump to content

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


Masoud

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
Link to comment
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 5
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...