1
votes

I am a complete novice to OpenGL, so I am just trying out some tests with it. I have a rectangle that I can rotate and translate around, and all is well.

The problem is, when I translate it below 1.0 Z, it disappears! I read about the depth buffer, and it says that its depth shouldn't be touched. Is there a way to work around this that I am completely missing? (Probably) If so, what is it?

1

1 Answers

4
votes

This is likely due to an incorrect projection matrix. When you setup your projection matrix, you need to specify the clipping planes (zNear and zFar) - anything outside of these will get "clipped away" and not show up.

For details, see gluPerspective.