disappearing stuff

lots of times when i translate back a ways, stuff will suddenly dissapear, and when i translate toward it again, it reappears. why? how can i stop that?

I suspect your stuff is being clipped by your far plane.

three ways to avoid this:

  1. move the far back plane further away
  2. move the camera when you move the objecg
  3. don’t move the object


i’m a beginner here, so help me out about. How can i move the far plane further back?

and i thought moving the camera and the object were the same thing, aren’t they? don’t they both happen when you use glTranslate? Or do i have to be in a different state or something to move the camera?

Your call to glOrtho() or glFrustum() lets you set the back clipping plane. Are you using a book? I would suggest the OpenGL SuperBible for beginners. This stuff is talked about early on.

The far clip plane is more or less how far the camera can see. Everything beyond this distance is not drawn.

The distance is set when you setup the projection matrix. The last parameter in the functions glFrustum/gluPerspective/glOrtho (don’t know which one you use, but the last parameter is the same, so it doesn’t make much difference) determines how far the camera can see. What john meant when he said you should move the far clip plane further away, is that you should increase this value.

I strongly suggest you have a look in the Red Book . Chapter 3 is about viewing.

thanks alot. yeah, i don’t have the resources (money) to go and buy a book. i use the red book, and asking lots of questions helps to, ya know? yeah, thanks.