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...
Re: Determine Ray -- Intersect with triangle
Thats a lot of math....you know that gametutorials.com has a tutorial for exactly that?
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?
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
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.