OpenGL depth issues

Feb 6, 2012 at 10:33pm
I am trying to write a basic 3D game with OpenGL and when I make the objects far enough back they disappear. What I want is to have the objects look smaller when they get further back. How can I get this to work?
Feb 6, 2012 at 10:46pm
Adjust the znear/zfar planes.
Look at glFrustrum()
Feb 19, 2012 at 12:15am
I tried adding this:
glFrustum(1.0, 1.0, 1.0, 1.0, 5, 100);
but it seemed to do nothing. What am I doing wrong?
Feb 19, 2012 at 12:39am
glFrustum is so last millenium.

I found this quite helpful:

http://en.wikibooks.org/wiki/OpenGL_Programming#Modern_OpenGL

Or, more specific to your problem:

http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_05

It uses OpenGL 2.0 so some deprecated functionality is used, but that's rather small-ish things (like using gl_FragColor and stuff like that).
Feb 19, 2012 at 2:06am
closed account (o1vk4iN6)
Don't see how it's last millenium as it's the same thing as doing glm::perspective. Simply different parameters, one which requires more knowledge than the other.

Glut is so last millenium, a lot of newer options are available, as well as open sourced.
Last edited on Feb 19, 2012 at 2:08am
Topic archived. No new replies allowed.