Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

How to calculate the distance between a Vector3 and a (3D polygon triangle)?

for example : " float DistanceToTrianale( Vector3 pos, Vector3 Edges1, Vector3 Edges2, Vector3 Edges3)

thanks in advance

share|improve this question
2  
Distance to where? The center of the triangle? –  bummzack Mar 29 '13 at 17:49
    
I say this not having easy access to it where I'm at right now, but have a copy of realtimecollisiondetection.net/books/rtcd on hand or you're doing life wrong. The answer boils down to using Voronoi regions and easy math, all explained in detail in that book. –  Sean Middleditch Mar 29 '13 at 21:17
    
bummzack - the Distance the nearest point in the triangle –  Johan Polson Mar 30 '13 at 0:26
add comment

1 Answer

up vote 1 down vote accepted

Here is a nice guide to the problem, with implementation:

http://www.geometrictools.com/Documentation/DistancePoint3Triangle3.pdf

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.