1
\$\begingroup\$

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

\$\endgroup\$
3
  • 2
    \$\begingroup\$ Distance to where? The center of the triangle? \$\endgroup\$
    – bummzack
    Commented Mar 29, 2013 at 17:49
  • \$\begingroup\$ 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. \$\endgroup\$ Commented Mar 29, 2013 at 21:17
  • \$\begingroup\$ bummzack - the Distance the nearest point in the triangle \$\endgroup\$ Commented Mar 30, 2013 at 0:26

1 Answer 1

1
\$\begingroup\$

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

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

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .