PDA

View Full Version : disappearing stuff



dutchstud
02-24-2002, 06:05 PM
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?

john
02-24-2002, 08:32 PM
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

cheers,
John

dutchstud
02-25-2002, 03:37 AM
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?

golgi apparatus
02-25-2002, 04:09 AM
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.

Bob
02-25-2002, 04:12 AM
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 (http://ask.ii.uib.no/ebt-bin/nph-dweb/dynaweb/SGI_Developer/OpenGL_PG/) . Chapter 3 is about viewing.

dutchstud
02-25-2002, 05:54 PM
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.