Posted 31 July 2001 - 06:30 AM
Hi, I have a little problem with selecting objects from my scene.
I found out that the problem in the code is, that in my resize function I have these lines of code:
if (w <= h)
glOrtho (-nRange, nRange, -nRange*h/w, nRange*h/w, - nRange *2, nRange*2);
glOrtho (-nRange*w/h, nRange*w/h, -nRange, nRange, -nRange*2, nRange*2);
with w being the window width, and h the height.
Know, when I use theese two lines of code, I get strange results, because somehow the things seem to be switched, when I click on one object, the selection buffer registers a hit for an other object.
Wheras when I substitute the four lines with this line:
gluPerspective(45.0f, fAspect, 1.0, 425.0);
it works, only that the scene isn''t resized correctly. Do you guys know the reason????