CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Deploying Windows Server 2008 with System Center
  • Remote Desktop Protocol Performance Improvements in Windows Server 2008 R2 and Windows 7
  • The Microsoft Dynamics CRM Security Model
  • SQL Server Modeling Services with Microsoft Visual Studio 2010 Beta 2

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > General Discussion > Algorithms & Data Structures
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Algorithms & Data Structures Discuss algorithms & data structures. Topics are not specific to any programming language.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old November 10th, 2009, 12:34 PM
    chire chire is offline
    Junior Member
     
    Join Date: Nov 2009
    Posts: 5
    chire is an unknown quantity at this point (<10)
    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.
    Reply With Quote
      #2    
    Old November 10th, 2009, 12:39 PM
    chire chire is offline
    Junior Member
     
    Join Date: Nov 2009
    Posts: 5
    chire is an unknown quantity at this point (<10)
    Re: Triangle Triangle Intersection Test Question

    the triangles are these visually

    T1
    O--------------------------------
    ----------------------------------
    ----------------------------------
    ----------------------------------
    ----------------------------------
    O------------------------------O

    T2
    O------------------------------O
    ----------------------------------
    ----------------------------------
    ----------------------------------
    ----------------------------------
    --------------------------------O
    Reply With Quote
      #3    
    Old November 11th, 2009, 04:34 AM
    wangzhi0417 wangzhi0417 is offline
    Junior Member
     
    Join Date: Nov 2009
    Posts: 1
    wangzhi0417 is an unknown quantity at this point (<10)
    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.
    Reply With Quote
      #4    
    Old November 16th, 2009, 03:26 PM
    chire chire is offline
    Junior Member
     
    Join Date: Nov 2009
    Posts: 5
    chire is an unknown quantity at this point (<10)
    Re: Triangle Triangle Intersection Test Question

    thanks i will try to tweak the algorithm and post my results here.
    Reply With Quote
      #5    
    Old November 17th, 2009, 11:00 AM
    chire chire is offline
    Junior Member
     
    Join Date: Nov 2009
    Posts: 5
    chire is an unknown quantity at this point (<10)
    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.
    Reply With Quote
      #6    
    Old November 30th, 2009, 08:49 PM
    chire chire is offline
    Junior Member
     
    Join Date: Nov 2009
    Posts: 5
    chire is an unknown quantity at this point (<10)
    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.
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > General Discussion > Algorithms & Data Structures


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 02:29 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.