As many newbies to OpenGL and Graphics Programming, I’m having some problems to set the zNear and zFar values for gluPerspective(). Given that I know how big my scene is and taking into account the possible Depth Buffer problems I may have if I set the near plane too close. How can I set these parameters correctly?
In few words, if I know the radius of the scene’s bounding sphere how can I set my projection the right way?
maybe it is simple:
Of course to find that centre you would have to iterate over whole visible objects or use some scene hierarchy.