POP attrack to nearest point
1646 2 1- Gagui
- Member
- 56 posts
- Joined: May 2017
- Offline
Hello.
I'm pretty noob with POPs and I'm having a hard time trying to figure out how to make particles be attracted by nearest points.
I can do something similar if I set "Match Method" to "average position" and setting the number of clusters to match the numbre of given points. But I'm looking for a way that every particle goes to the nearest point automatically without setting numbre of clusters.
If I use "Point per Particle" method every particle choose a target point randomly. Maybe I have to set some attribute for proximity mathcing but I have no idea how to do it in Popnet.
Any help?
In the attached image we can see what I did with clusters method and what I get with Point per Particle method.
Particles are generated form the big circle points and attracted to the 3 external points.
I'm pretty noob with POPs and I'm having a hard time trying to figure out how to make particles be attracted by nearest points.
I can do something similar if I set "Match Method" to "average position" and setting the number of clusters to match the numbre of given points. But I'm looking for a way that every particle goes to the nearest point automatically without setting numbre of clusters.
If I use "Point per Particle" method every particle choose a target point randomly. Maybe I have to set some attribute for proximity mathcing but I have no idea how to do it in Popnet.
Any help?
In the attached image we can see what I did with clusters method and what I get with Point per Particle method.
Particles are generated form the big circle points and attracted to the 3 external points.
Edited by Gagui - March 18, 2022 15:51:02
- Enivob
- Member
- 2630 posts
- Joined: June 2008
- Offline
Here is a basic setup. The concept is you supply an additional point location, such as your target P to each particle. Then when it comes time to evaluate that particle's motion, you can run in VEX mode to supply the v@goal_P as the destination for each particle. I prefer the PopSteerSeek because it offers braking on approach, but you could do the same thing with a PopAttract.
The circle is divided into three segments with the points in each segment being supplied one of the triangle points as v@goalP.
Here is a variation with a 24 frame release and a severe braking force.
The circle is divided into three segments with the points in each segment being supplied one of the triangle points as v@goalP.
Here is a variation with a 24 frame release and a severe braking force.
Edited by Enivob - March 20, 2022 18:38:38
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
- Gagui
- Member
- 56 posts
- Joined: May 2017
- Offline
Hi Enivob.
That's great! Although your setup doesn't find the nearest point automatically I could find a way to do it based on your suggestion.
Just replacing this piece of code:
by this one:
Where instead of setting manually a goal point for each particle we can leave "nearpoint" choose wich point is the nearest for each particle.
Now I have what I need, thanks!
And BTW PopSteerSeek is much better for my needs, thanks again!
That's great! Although your setup doesn't find the nearest point automatically I could find a way to do it based on your suggestion.
Just replacing this piece of code:
v@goal_P = point(1,"P",2);
i@nearp = nearpoint(1, @P); v@goal_P = point(1,"P",@nearp);
Where instead of setting manually a goal point for each particle we can leave "nearpoint" choose wich point is the nearest for each particle.
Now I have what I need, thanks!
And BTW PopSteerSeek is much better for my needs, thanks again!
Edited by Gagui - March 21, 2022 06:15:21
-
- Quick Links