Jump to content

Proximity Pop


SpencerL

Recommended Posts

Hey,

I think there was a post about this not too long ago, but I cant seem to find it. Anyways, I have two particle groups, Group A and Group B. Basically, I want one particle group to find the nearest neighbor in the other. The problem I am having is trying to sort out how Group A only finds nearest neighbor in Group B and not in itself. Currently Group A ends up getting nearest neighbors that are inside Group A. Not sure how to occlude Group A. Suggestions would be great!

Thanks.

Link to comment
Share on other sites

Hey,

I think there was a post about this not too long ago, but I cant seem to find it. Anyways, I have two particle groups, Group A and Group B. Basically, I want one particle group to find the nearest neighbor in the other. The problem I am having is trying to sort out how Group A only finds nearest neighbor in Group B and not in itself. Currently Group A ends up getting nearest neighbors that are inside Group A. Not sure how to occlude Group A. Suggestions would be great!

Thanks.

you might want to have a look at the nearpoint expression. Not sure if this is the best way to do it, but take group A and B and split them into two seperate sop chains. In one chain add and attibuteCreate and do something like this

nearpoint("../particlesA",$TX,$TY,$TZ)

hope that helps

Let me know if you have any trouble

Link to comment
Share on other sites

  • 5 years later...

I've got the same problem here, want to do a closest point lookup from one group of particles to another.

I'm aware of the nearpoint() expression, but don't really want to leave pops but rather stay inside of one Popnet.

Pointcloud lookups also crossed my mind, but then again there's no way to look up only a single group inside of a VOP POP (at least not that I know of).

Is there any way to do this just within one popnet? VOPs, VEX, Python, I'm open for every suggestion?!

thanks,

Manu

Link to comment
Share on other sites

Hmmm, not that I'm aware of. The trouble is masking one group away from another.

I suppose you could make a python otl that would query all the points within

a group and then you could loop over those points and calculate distance.

the point with the smallest distance would be your nearest point. It would probably be slow though(if you're siming a lot of points)

not sure if the python hooks will let you put your points in a kdtree (you can with the hdk)

but using that would probably be faster than looping through all the points.

haven't done it myself, but hopefully it helps.

Link to comment
Share on other sites

there's actually I mean hack to do it,

by having a popsolver and a sopsolver. This way you can isolate one group in the sopsolver, dopimport those points into a sopgeometry object

and then load those points as a pointcloudtexture into your pcopen. (you tell the voppop only to query the other pointgroup)

I should say that relative paths don't work in this case so you'd input rather a full path or you could use the opfullpath hscript expression,

that way your pcopen will find the points. Also it helps if the sopsolver is calculated before the

popsolver in order to get the most accurate results!

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