Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Triangle-Triangle intersection

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2004

    Triangle-Triangle intersection

    I've read Tomas Moller's "A Fast Triangle-Triangle Intersection Test" article and I'm using his code, but if the two triangles share a single vertex the function always returns true.

    I need to be able to test if two triangles sharing a single vertex are intersecting.

  2. #2
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    S41.16.25 E173.16.21

    Re: Triangle-Triangle intersection

    yes i had the sample problem, (nature of computer precision etc) anyways of the 15 or so tri-tri intersection tests i have seen only a couple actually work 100% the rest fall down (as in they will report sometimes hit or sometimes miss) when u get to shared edges/points. one was based on Tomas Moller's code (by a finnish guy who worked on some visual determination software) sorry i cant be more helpful, but search here
    from about a couple of years ago.
    personally i cant believe this is a bigger issue eg not tri-tri but tri-ray
    Code :
    ok here we have a quad divided into 2 triangles right, sharing the same edge. say u have a ray aimed at the quad passing through the shared edge 90% of tri-ray tests will report it didnt hit either of the tris (in some cases).

    another possible method u could use (safer but slower) is to do a tri-tri distance test dave eberly's magicsoftware has lots of code for this

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts