# 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.

Edited by Masoud

##### Share on other sites

like this or more directable, yeaa it is manageable.
combining from those two DUdes

you can build your own asset for particles
https://tosinakinwoye.com/2017/01/23/houdini-vex-snippets/

Edited by Librarian
• 1

##### Share on other sites

Hi "Tesan";

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

##### 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

• 4

##### Share on other sites

Hi, Henry

The second one worked for me, very useful tips.

Thanks.

##### Share on other sites

Here is a write-up of all particle attributes in case you need them:
https://www.sidefx.com/docs/houdini/dopparticles/attributes.html

• 1

##### Share on other sites
On 5/1/2020 at 4:50 PM, konstantin magnus said:

Here is a write-up of all particle attributes in case you need them:
https://www.sidefx.com/docs/houdini/dopparticles/attributes.html

Thank you!

## Create an account

Register a new account