When using glOrtho2D( ), my mouse handler would return an int x, y position of the mouse click.
I could then set the pixel at that point to a particular color, etc.
I am trying 3D drawing now, with the following:
glViewport (0, 0, 500, 500);
gluPerspective(65.0, (GLfloat) 500/ (GLfloat) 500, 1.0, 20.0);
gluLookAt (0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
Now, when i click the window with my mouse, I still get integer coordinates - but they can no longer be displayed on the window.
The problem is that the scaling has changed, so that plotting (0,0,0) is at the center of the window, and (1,0,0) is about an inch to the right of the origin - instead of just one pixel to the right.
Is there any way at all to use mouse coordinates with the perspective projection functions?