isah_voodoo Posted October 26, 2019 Share Posted October 26, 2019 Hello, I am trying to get the minpos function to work properly. I have a line and a ball. From the ball, I want to store the closest position of the line in an attribute. I thought that if I were to move my ball closer to a different point on the line, it would store that point position in the attribute I created. This is not working for me. Everything is set to 0 in the geo spreadhseet. I will attach my scene file for anyone that wants to take a look. Thank you minpos_question.hip Quote Link to comment Share on other sites More sharing options...
toadstorm Posted October 26, 2019 Share Posted October 26, 2019 Your attribute "v@p2" doesn't exist on the ball, yet you're trying to reference it in your point wrangle. I'm not really sure what you're trying to do with that attribute, to be honest. Here's an example of what I think you're trying to do... The original sphere is templated, and the nearest point is shown as a cube sliding along the line. minpos.hip Quote Link to comment Share on other sites More sharing options...
isah_voodoo Posted October 26, 2019 Author Share Posted October 26, 2019 @toadstorm Thank you for the file toadstrom. I thought that the v@p2 was coming in from the second input ? v@storePos=minpos(1, v@p2); Actually , your file gave me a lot of good insight on whats going on with minpos. I didn't realize that it would actually interpolate the values between each point on the line. I was expecting minpos to actually snap the ball to each point on the line as it got closer. I guess that would still be possible ? Thanks Quote Link to comment Share on other sites More sharing options...
toadstorm Posted October 26, 2019 Share Posted October 26, 2019 Yeah, that's straightforward enough. Just use the nearpoint() function to get the nearest point number to a position in space, then fetch P from that point. minpos_nearpoint.hip Quote Link to comment Share on other sites More sharing options...
isah_voodoo Posted October 26, 2019 Author Share Posted October 26, 2019 @toadstorm thank you 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.