zzangxx Posted February 21, 2011 Share Posted February 21, 2011 (edited) I want to find the closest point on the primitive from one critical point using HDK. Actually, it is easy to solve this problem( using the class : MMeshIntersector MPointOnMesh, function : getClosestPoint ) in Maya API. Is there any similar class or function(GEO type)? Edited February 21, 2011 by zzangxx Quote Link to comment Share on other sites More sharing options...
Scot Shinderman Posted February 22, 2011 Share Posted February 22, 2011 zzangxx, there are some routines available in GU/GU_RayIntersect.h (w/ GU_FIND_CLOSEST)-- it looks like it takes a GU_Detail so I guess it would have to populated one primitive at a time. Perhaps there's a more incremental function version out there? -s- Quote Link to comment Share on other sites More sharing options...
zzangxx Posted February 22, 2011 Author Share Posted February 22, 2011 (edited) zzangxx, there are some routines available in GU/GU_RayIntersect.h (w/ GU_FIND_CLOSEST)-- it looks like it takes a GU_Detail so I guess it would have to populated one primitive at a time. Perhaps there's a more incremental function version out there? -s- Thank you for your response. However, I already saw that header. It include some functions that is sendRay,minimumPoint, proximityPoint and so on. That function's return value is int type. I want to know the closest point on the primitive (input : primitive , one point // output : closest point). How can I use that? Edited February 22, 2011 by zzangxx Quote Link to comment Share on other sites More sharing options...
petz Posted February 22, 2011 Share Posted February 22, 2011 (edited) Thank you for your response. However, I already saw that header. It include some functions that is sendRay,minimumPoint, proximityPoint and so on. That function's return value is int type. I want to know the closest point on the primitive (input : primitive , one point // output : closest point). How can I use that? use GU_RayIntersect::minimumPoint() this stores the closest primitive with uv values of the clostest point in GU_MinInfo::Prim. then you have to use GEO_Primitive::evaluateInteriorPoint() which returns the actual position of the closest point as UT_Vector4. hth. petz Edited February 22, 2011 by petz Quote Link to comment Share on other sites More sharing options...
zzangxx Posted March 14, 2011 Author Share Posted March 14, 2011 Thank you so much~!! 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.