HELP!!! Simple glOrtho problem! - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: HELP!!! Simple glOrtho problem! (/thread-3207.html)
HELP!!! Simple glOrtho problem! - Marvin - Jun 26, 2007 01:34 PM
can anyone explain to me why this code doesn't generate a visible red line from the left bottom to the top right corner of my window?
As you can see, I have specified the viewable volume as a cube of length one, one corner at (0, 0, 0), the other one at (1, 1, 1). I'm drawing the diagonal line through these two corners, so what I should expect on the 2D window surface is a diagonal line across the window. Why isn't this happening? My window remains BLACK.
Please help. This is such a simple thing, and I'm stuck at this already.
HELP!!! Simple glOrtho problem! - reubert - Jun 26, 2007 03:05 PM
glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
glVertex3f(0.0f, 0.0f, 0.0f);
glVertex3f(1.0f, 1.0f, 0.0f);
my guess is that your vertices are both getting culled
HELP!!! Simple glOrtho problem! - Realization - Jun 26, 2007 06:29 PM
Could you post your reshape function? Maybe you're not looking in the right place.
HELP!!! Simple glOrtho problem! - Marvin - Jun 27, 2007 10:23 AM
Hey folks, problem solved!
Didn't know GL_MODELVIEW is by default made to look down the negative z-Axis. Made the necessary adjustments.
As for my reshape function, it just calls the display function