pelos Posted December 30, 2018 Share Posted December 30, 2018 I am starting to use the nearpoint expression but I don't think is working properly, here is an example, I just want to know how is the closest point, here is an example file with 3 points, but the attribute say -1, why is that ? near_expression_not_working.hip Quote Link to comment Share on other sites More sharing options...
Noobini Posted December 30, 2018 Share Posted December 30, 2018 (edited) 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 December 30, 2018 by Noobini Quote Link to comment Share on other sites More sharing options...
Noobini Posted December 30, 2018 Share Posted December 30, 2018 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. Quote Link to comment Share on other sites More sharing options...
pelos Posted January 2, 2019 Author Share Posted January 2, 2019 thanks! that's smart =) 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.