Jump to content

Need a little help about point cloud system


Recommended Posts

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

Link to comment
Share on other sites

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");
    }

  • Like 1
Link to comment
Share on other sites

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

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