Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17560

Closest point on triangle

$
0
0
I was poking around looking for an algorithm for finding closest point on a triangle. Found this one on these forums: http://www.gamedev.net/community/forums/topic.asp?topic_id=516608 I kind of recognized it so I tried it out and it doesn't work. :( This paper describes the correct way to solve what the algorithm above tries to do: http://www.geometrictools.com/Documentation/DistancePoint3Triangle3.pdf However it's heavy on math and does not give the complete source code. Here is the complete source code:
vector3 closesPointOnTriangle( const vector3 *triangle, const vector3 &sourcePosition )
{
    vector3 edge0 = triangle[1 …
!--source>!--startscript-->

Viewing all articles
Browse latest Browse all 17560

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>