Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: How to get an intersection point

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2003
    Posts
    3

    How to get an intersection point

    Hi, I need to know how to get the coordinates of an intersection point. I have the following situation:

    An object and a line. The line hits the object -> now I need to figure out the exact coordinates where the line intersects the object (further on I need to know the distance of the origin of the line to this point of intersection, wheras I can calc it myself as soon as I got the coords of the intersection point).

    How do I do that with OpenGL ?

    Thanks in advance.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,651

    Re: How to get an intersection point

    Hi !

    You can't do it with OpenGL.

    But there are lots of tutorials on intersetions, most ray tracing tutorials also has useful information on this, have a go with google to find them.

    Mikael

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    668

    Re: How to get an intersection point

    If you have the vector if the line i.e. point1-point2 then you also have the equation of the plane (object/polygon you are hitting) then you can work it out from this.... serach for point interesctin a plane, there should be answers for that on this forum. Working out which planes to check against is another thing though... so as Michael says check out raytracing stuff as this is exactly what that does.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Jan 2003
    Location
    Virginia
    Posts
    601

    Re: How to get an intersection point

    Check out http://www.gametutorials.com/Tutoria...OpenGL_Pg3.htm which has 2 tutorials similar to what you want.

  5. #5
    Junior Member Newbie
    Join Date
    Mar 2003
    Posts
    3

    Re: How to get an intersection point

    thanx shinpaughp, it is a great and helpful link -> solves my problem and more.

    also thanx, to all the others who replied.

    CU.

Posting Permissions

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