I’m using gluUnProject to convert Screen coordinates to OpenGL. For most of the time it works fine but sometimes the function returns wrong value.
For example I move mouse around the screen and Z value are Ok until the cross -120. Then the Z value is suddenly -630. The X value is OK.
I would be grateful for any tip what can cause this problem.