Jump to content
isah_voodoo

minpos not working

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

@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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×