Picking AGAIN.....with glFrustum()

Hello…

I’m currently implementing a picking-application.

  1. I got it running with “gluPerspective” in my reshape()-method, but now i use “glFrustum” there and i get no hits…
    What could be the problem ?

  2. Another thing concerning glfrustum:
    How can I move the near clipping plane ?
    Its in middle of the scene and clips things away that are not supposed to be clipped away . :frowning:

THX

gluPerspective is a useful helper routine; is there a concrete reason you switched away from using it?

Its because of the clipping plane thing…

I didnt know how to move them, so i tried it with glFrustum.

I had better results with using glFrustum, but it is still not satisfying.

The zNear and zFar arguments to gluPerspective specify the distance from the eye point of the near and far clipping planes. Decreasing zNear should move the plane closer to the eye point. Keep in mind that you also should keep zNear and zFar as close to each other as possible because otherwise you will see depth buffer precision artifacts like triangles appearing to go through each other. In particular there is some rule which I don’t remember exactly like there should not be more than a few orders of magnitude between zNear and zFar; a zNear of 0.0001 and a zFar of 10000 is a bad idea.