jojomadstar Posted September 8, 2016 Share Posted September 8, 2016 Hi guys This supposed be a simple question...but i just can't figure out for hours. Here is the situation. I have a point cloud system, query position is few particles which run through bunch of scatter points. The goal is to get the distance between those point cloud points and their source point, so i can give a Cd value based on that distance. But some how i just couldn't get the correct distance value. I attach the hip file here. Hope some one can help me out... PS: apologized for bad English HelP.hip Quote Link to comment Share on other sites More sharing options...
Sean-R Posted September 15, 2016 Share Posted September 15, 2016 Hey Ryan, Not sure if you sorted this but though I'd give it a try. I managed to get the distance value by placing your vop where you scatter your points into a for each loop and then iterating over each particle. HelP_SeanR.hipnc Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted September 15, 2016 Share Posted September 15, 2016 Hi I think the pc functions inside the vop is a bit messy, its easier to do in vex in an wrangle. Heres an quick example of how you can do it in vex, since the distance is float its stored in @Cd.r, just for visuals. @Cd = 0; vector position; float dist,searchdist; searchdist = chf("searchdist"); int handle = pcopen(1,"P",@P,searchdist,chi("searchpoints")); while(pciterate(handle)){ pcimport(handle,"P",position); pcimport(handle,"point.distance",dist); int point = addpoint(0,position); dist = fit(dist,0,searchdist,0,1); setpointattrib(0,"Cd",point,dist,"set"); } 1 Quote Link to comment Share on other sites More sharing options...
jojomadstar Posted September 19, 2016 Author Share Posted September 19, 2016 Thx for all the reply. Really appreciate it Actually after asking many ppl and tried other stuff. I figured out other solution for this. Using PoingCloud isn't necessary. Using for each loop out side the vop and point replicate can simply do the job. Much more strait forward. But anyway I also got other solution from my instructor Peter by using point.distance fit range with Pscale (my searching radius) to get the same result... HelP.hipnc 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.