I need to detect the colision between a line and a rectangle.
The procedure i am using is something like this:
- Convert the line world coordinates into window coordinates using gluProject.
- Check the colision between the line and the rectangle (the rectangle is in window coordinates).
Although this procedure works fine i am having problems if the line isn’t totally onscreen.
For example, if one line starts at the left of the window screen i was expecting that gluProject returned a negative X coordinate, but it doesn’t…
What i am missing here? Thank you for your help.