SpencerL Posted August 16, 2006 Share Posted August 16, 2006 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. Quote Link to comment Share on other sites More sharing options...
doc Posted August 16, 2006 Share Posted August 16, 2006 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 Quote Link to comment Share on other sites More sharing options...
SpencerL Posted August 16, 2006 Author Share Posted August 16, 2006 Sweet! Thats exactly what I was lookin for. Thanks! Quote Link to comment Share on other sites More sharing options...
asnowcappedromance Posted February 6, 2012 Share Posted February 6, 2012 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 Quote Link to comment Share on other sites More sharing options...
doc Posted February 12, 2012 Share Posted February 12, 2012 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. Quote Link to comment Share on other sites More sharing options...
asnowcappedromance Posted February 13, 2012 Share Posted February 13, 2012 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.