Archived

This topic is now archived and is closed to further replies.

Gammastrahler

triangle intersection test?

Recommended Posts

hi, i need a little bit help on writing a triangle intersection function. i want to test if a vector intersects a triangle. how could i do that? it is not important where the intersection point is, if any, i only want to check whether it intersects or not thanks!

Share this post


Link to post
Share on other sites
To get started, check out:
http://www.realtimerendering.com/int/
and
http://www.gametutorials.com/Tutorials/OpenGL/OpenGL_Pg3.htm

If you still need help, I''ll see what I can do.

Share this post


Link to post
Share on other sites
Hi Gammastrahler,

You want to check if a triangle and a segment collide?
I had to solve a similar problem and did it in the following way:

First find the intersection Ip between the line described by your vector and the plane described by your triangle.
Check wether Ip lies inside of the segment. If not, no collision.

If yes, check wether Ip is inside of the triangle. If not, no collision.

Let me know if you need more details.

Cheers,

Marc



Share this post


Link to post
Share on other sites