Question

I have a problem using glOrtho in a program that uses GLMDraw() function of GLM library to draw Google SketchUp 3D images. I wanted to see the image for only certain values of z in Projection mode and glOrtho() didn't seem to work so I made the following code to test it:

glOrtho(0.0f, 2.0f, 0.0f, 2.0f, 0.0f, 0.0f);

Since near and far planes are the same I thought I should see no image but I see the whole image. What I am missing?

Was it helpful?

Solution

If you call glOrtho with znear=zfar, it generates a GL_INVALID_VALUE error, and probably just discards the call.

http://www.opengl.org/sdk/docs/man/xhtml/glOrtho.xml

Try giving it a range greater than zero.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top