ccouto
09-08-2011, 04:07 AM
Hello
I need to detect the colision between a line and a rectangle.
The procedure i am using is something like this:
1. Convert the line world coordinates into window coordinates using gluProject.
2. 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.
I need to detect the colision between a line and a rectangle.
The procedure i am using is something like this:
1. Convert the line world coordinates into window coordinates using gluProject.
2. 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.