Jump to content

Closest point on the primitive


Recommended Posts

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 by zzangxx
Link to comment
Share on other sites

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 by zzangxx
Link to comment
Share on other sites

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 by petz
Link to comment
Share on other sites

  • 3 weeks later...

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