PDA

View Full Version : negative znear or zfar values in glOrtho



04-13-2001, 09:40 AM
I have a question regarding glOrtho:
glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far);

now when the "near" and "far" parameters have different signs - like the "near" value is negative and "far" value positive and the eye is at the origin, then the eye is actually inside the viewing volume. In this case, where is the projection plane and how does hidden surface removal take place?

any insight will be much appreciated. thanks.

amrita.

mango
04-13-2001, 07:29 PM
Why do you want to know?
I guess the depth buffer will work as normal but setting the near value negative will throw away some precision. I do not see what you will get in return.
Objects outside the view frustum is not a problem with or without enabling the depth buffer.

Michael Steinberg
04-14-2001, 12:01 AM
It doesn't make any sense and it isn't allow I think.

DFrey
04-14-2001, 05:09 AM
The screen is always at z=0. So if you set zNear less than 0 (which gluOrtho2D does by the way), then it puts that plane behind the viewpoint.

Michael Steinberg
04-14-2001, 05:40 AM
It would be like if your monitor is the film in a camera... http://www.opengl.org/discussion_boards/ubb/smile.gif

[This message has been edited by Michael Steinberg (edited 04-14-2001).]