I’ve encountered a problem that stuck me for a couple of days already.
I used to have 4-view on my screen, set by glViewport separately on drawing.
But I couldn’t be able to pick object correctly following Redbook’s example.
I always can’t get the viewport right on a mouse click event by glGetIntegerv(GL_VIEWPORT, viewport), even i’ve determined which viewport the mouse cursor belongs to
I think this is due to i modify the viewport 4 times on drawing the 4 view.
What makes it even worse is, if I set the viewport in gluPickMatrix after determining the cursor position instead of using glGetIntegerv(…), I even can’t make any selection hit.