Jump to content

near point not working?


pelos

Recommended Posts

you plugged the input into the 1st port of the wrangle so

nearpoint(1, @P);

should be

nearpoint(0, @P);

1st input index is 0

2nd input index is 1

3rd - 2

4th - 3

OR don't change the VEX but wire your input to the 2nd port, same result

also should declare your @near as i@near otherwise it give you float  rather than int.

but observe, in each case it will say itself as the closest...since......it IS......

Edited by Noobini
Link to comment
Share on other sites

so if you do this to get an array of points rather than THE closest,

i[]@near = nearpoints(0, @P,10);  // 10 is search distance

you'll see the result:

[ 0, 1, 2 ]
[ 1, 0, 2 ]
[ 2, 1, 0 ]


corroborating with previous result that the 1st closest point is itself, so the result you want is in the 2nd column...bit long winded but that's what you get if you compare a bunch of points to themselves

If you were comparing your 3 points against a bunch of points say from a sphere made somewhere else...then it's fine coz you're not comparing those points against themselves.

 

 

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