Can anyone explain what the zNear and zFar parameters in glOrtho should be? I am developing a 3D modeling environment, so models may not always be centered about the origin. When I frame the view to show the entire model, I redefine the projection with glOrtho using the center of the data and the radius of the bounding sphere so that my glOrtho parameters become:
left = centerX - radius
right = centerX + radius
top = centerY + radius
bottom = centerY - radius
near = centerZ + radius
far = centerZ - radius
However, when I send these parameters into glOrtho portions of the model get clipped as I rotate about the center of the data. I’ve had to increase the radius by a factor of 5 to keep this from happening, but then the precission of the depth buffer goes down more than it should. Should I be defining the near and far parameters differently?