Jump to content

Using nearpoint() and nearpoints()


SteveNi

Recommended Posts

Hi

 

So basically I have some points and a "source" point, I want to find the closest points to the source point, so I tried to use the nearpoint() and nearpoints() functions but when I try to print out the results I get no points... http://prntscr.com/cjgofb

Is the syntax wrong or something?

I attached a scene for reference.

Thanks.

test_findPoints.hipnc

Link to comment
Share on other sites

Hi, SteveNi

I don't know if it's the best solution but it work like that.

vector pPos = attrib(1, "point", "P", 0);
int maxpoints = 1;
float dist = 0.2;

int pnt_near[] = nearpoints(0, pPos,dist, maxpoints);

printf("%s \n", pnt_near);

Charles

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