I’m a little confused on this. Let’s say I have a cube that is 4x4x4 and I use glOrtho to set the size of my view volume to, for example:
glOrtho( -5, 5, -5, 5, -5, 5 );
Now, let’s say we use the default view which is looking down the z axis with our location at the origin. When I enter selection mode and attempt to select an object that is at, say, (0,0,-2), I get a negative z depth in my hit record instead of, as I would expect, a large positive number i.e. [0…1] * 2^32-1, with 0 representing the front plane and 1 representing the back plane. Does anyone know why this is happening, especially since depth testing seems to be working properly when I draw the objects on the screen?