kosimoto Posted February 23, 2013 Share Posted February 23, 2013 Does anyone know how to get the closest location on the surface of a mesh in VOPS? Like the ray SOP but through vops. Its pretty easy to get the closet point position but getting a surface location and storing it seems to be pretty cumbersome in Houdini. In Softimage ICE they have a concept of locations. The location is a pointer to a specific point on a mesh that can be stored in an attribute and used later. I'm looking for that sort of process but in vops. Thanks for any help Quote Link to comment Share on other sites More sharing options...
mdunkley Posted February 23, 2013 Share Posted February 23, 2013 (edited) Hey John. The "intersect" VOP is the vops version of ray. It will give you back the worldspace position and parametric UV's of the hit. I think parametric UV's are the closest thing to what you're talking about - store those on your intersected points, and you can use them later in another vopnet thorugh the "primitive attribute" vop to , for instance, reevaluate the "P" attribute for your test geometry if its transformed later in your sop network (ie - stick the intersected points to moving geometry). Edited February 23, 2013 by mdunkley Quote Link to comment Share on other sites More sharing options...
kosimoto Posted February 25, 2013 Author Share Posted February 25, 2013 Thanks for the help this works. I actually don't want to have to create the ray, but the parametric UV's are a comparable solution. Quote Link to comment Share on other sites More sharing options...
Solitude Posted February 25, 2013 Share Posted February 25, 2013 I requested a vops method for min distance a while back, as well as allowing the storing of attributes when using minimum distance, but nothing ever came of it.... In sops though, you can store the position before the ray (rest position), transform the points in the ray sop and then store the new pos (newpos), and then restore it afterwards to the rest position. It's kind of lame, yes, but it works. In vops, if you have an sdf of the original geometry you can use the volume gradient to at least get the direction to the surface, then use the intersect vop to get the information about the hit, etc. If you have an sdf you can also get a pretty close position (depending on how detailed the volume is) by using the gradient and volume sample together. This is actually quite common in Houdini, and can be a lot faster than using ray intersections. Quote Link to comment Share on other sites More sharing options...
sanostol Posted February 25, 2013 Share Posted February 25, 2013 http://schnellhammer.net/blog/2011/08/houdini-closest-primitive-vex-function/ Quote Link to comment Share on other sites More sharing options...
Solitude Posted February 25, 2013 Share Posted February 25, 2013 Thx for the link, Martin. I've seen that one before, forgot where. Would be nice to have a version of that included by sidefx. I still opt for sdfs in most cases though. 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.