Results 1 to 5 of 5

Thread: Determine Ray -- Intersect with triangle

  1. #1

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Determine Ray -- Intersect with triangle

    Given the player position (5,10,6);
    Given the triangle P1(0,-10,0) P2(0,0,50) P3 (50,5,0);

    How do I fire a ray from the player which is above the triangle, down into the triangle and determine if there is going to be an intersection?

    I believe rays go on forever...but this ray needs to terminate after it has travelled the length of the players new pos minus his old pos...
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  2. #2
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: Determine Ray -- Intersect with triangle

    Thats a lot of math....you know that gametutorials.com has a tutorial for exactly that?

  3. #3

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Re: Determine Ray -- Intersect with triangle

    A tutorial is just as good as an answer...cept I've searched the majority of gametutorials and I am finding nothing on ray/triangle collision.

    I found ellipsode collision and about halfway into the article it says this method is pathetic for colliding with polygons..only works with planes....

    This stuff is getting confusing -- and kinda annoying...

    So can you either find the tutorial you meant for me? give me a url.
    or
    Tell me if I should be doing collision with elliposodes to plane or ray to triangle or both?
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  4. #4
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: Determine Ray -- Intersect with triangle

    The tutorial "Line Segment and Polygon Collision" on this page tells you what you need...

    http://gametutorials.com/Tutorials/o...OpenGL_Pg3.htm

  5. #5

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Re: Determine Ray -- Intersect with triangle

    Nice tutorial

    I also am using this one
    http://www.peroxide.dk/download/tuto.../pxdtut10.html

    You should read the first bit of math explanations...very neat stuff..I never knew myself how to proove a system (R2,R3 for example), prove the system compared the axiom rules....neat stuff.

    Anyway, I guess this is resolved.
    Thanks.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

Posting Permissions

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



Click Here to Expand Forum to Full Width