| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Algorithms & Data Structures Discuss algorithms & data structures. Topics are not specific to any programming language. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Triangle Triangle Intersection Test Question
Hello,
im implementing Tri-Tri Intersection Test, with Moller algorith LINK: http://www.cs.lth.se/home/Tomas_Aken.../opttritri.txt but im having a problem because it is detecting as intersected some triangles that only share a vertex o an edge, i would like only to detect the ones that pass trhough another one. for example these two adjacent triangles share an edge, like meshes do. Tri-1 V0( 1.0f, 0.0f, 0.0f) V1( 0.0f, 1.0f, 0.0f) V2( 0.0f, 0.0f, 0.0f) Tri-2 U0( 1.0f, 0.0f, 0.0f) U1( 1.0f, 1.0f, 0.0f) U2( 0.0f, 0.1f, 0.0f) what modifications should be done to the algorithm to filter thoese cases? Last edited by chire; November 16th, 2009 at 04:19 PM. |
|
#2
|
|||
|
|||
|
Re: Triangle Triangle Intersection Test Question
the triangles are these visually
T1 O-------------------------------- ---------------------------------- ---------------------------------- ---------------------------------- ---------------------------------- O------------------------------O T2 O------------------------------O ---------------------------------- ---------------------------------- ---------------------------------- ---------------------------------- --------------------------------O |
|
#3
|
|||
|
|||
|
Re: Triangle Triangle Intersection Test Question
I just reviewed the related paper, to discard the cases when two triangles intersect at a vertex, I think you can:
1) For coplanar triangles, when intersecting edges (assume edge_A from the first triangle, and edge_B from the other triangle), we should discard the case when edge_A and edge_B meet at a vertex, that is the intersection point should not be the end of edge_A/edge_B. 2) For non-coplanar triangles, when two triangles meet at a vertex, the interval of overlap on the L (the intersection line of the two underlying planes of the two triangles) should be degenerate, i.e., a point comparing to a line segment in other cases. |
|
#4
|
|||
|
|||
|
Re: Triangle Triangle Intersection Test Question
thanks i will try to tweak the algorithm and post my results here.
|
|
#5
|
|||
|
|||
|
Re: Triangle Triangle Intersection Test Question
im thinking that i could check before if they share 2 vertexes (equivalent as sharing an edge) and filter that case, i can check for that before caling the algorithm
what remains is the case of one shared vertex which you are right on looking at the length of the intersection line L Last edited by chire; November 17th, 2009 at 11:25 AM. |
|
#6
|
|||
|
|||
|
Re: Triangle Triangle Intersection Test Question
i am finally pre-filtering the adjacent triangles, may them be VERTEX or EDGE shared. with simple checking or the index array with the vertex buffer object.
at the moment, is working really really good. some images Non-Collided ![]() Collided
Last edited by chire; November 30th, 2009 at 09:11 PM. |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|