Jump to content

Expression Help


Solitude

Recommended Posts

So, lets say I have a polygonal mesh (mesh A), and have another mesh / helper (mesh B) that I always want to point to the closest point on mesh A, I can get the closest distance, and the UV coord of that closest point via the xyzdist expression, but I can't figure out how to turn the info from that into a world coordinate position that I can use elsewhere. Even the ray sop can't technically give me what I want, because it requires normals to work in the first place... so if anybody can help, thanks in advance! P.S. I know it can be done (kind of) with an sdf and volume gradient / volume sample vops, but for fun, lets just pretend those aren't an option. :D

Link to comment
Share on other sites

So, lets say I have a polygonal mesh (mesh A), and have another mesh / helper (mesh B) that I always want to point to the closest point on mesh A, I can get the closest distance, and the UV coord of that closest point via the xyzdist expression, but I can't figure out how to turn the info from that into a world coordinate position that I can use elsewhere. Even the ray sop can't technically give me what I want, because it requires normals to work in the first place... so if anybody can help, thanks in advance! P.S. I know it can be done (kind of) with an sdf and volume gradient / volume sample vops, but for fun, lets just pretend those aren't an option. :D

Use the ray SOP set to 'minimum distance' use that as info for a vop sop or whatever ... an SDF is probably faster though if your mesh is super dense.

Link to comment
Share on other sites

Use the ray SOP set to 'minimum distance' use that as info for a vop sop or whatever ... an SDF is probably faster though if your mesh is super dense.

ahhhhh... funny how easy it is to overlook stuff. :D Thanks!

Ok, new question which is related: is there a way to use this functionality from within a VopPop? The intersect vop doesn't have minimum distance as an option.

Edited by Solitude
Link to comment
Share on other sites

ahhhhh... funny how easy it is to overlook stuff. :D Thanks!

Ok, new question which is related: is there a way to use this functionality from within a VopPop? The intersect vop doesn't have minimum distance as an option.

Intersect will use the length of your normal as your hit distance

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