PDA

View Full Version : More Dissapearing Problems



dutchstud
02-27-2002, 11:45 AM
I set the Frustrum so the back plane is at 200.0f, but still when i translate back past about 1.0f my object dissapears. it's a simple object, a triangle right now i believe, and it doesn't even look smaller when i scale back, and i have no idea what is going on. any help?

tempocrew
02-27-2002, 11:49 AM
The positive z axis is out of the screen by default. You are therefore translating your object in front of your near plane, that's why you can't see it. You need to translate into the screen, using a negative z value.

dutchstud
02-27-2002, 11:53 AM
it also dissapears when i translate the other way. i think my program might somehow be set on 2d or something, because when i change the z values on the quad the quad still takes up the whole screen. this is really frustrating me!
maybe my frustrum is wrong, is it supposed to be in init?
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-100.0, 100.0, -100.0, 100.0, -100.0, 100.0);
is that right?

[This message has been edited by dutchstud (edited 02-27-2002).]

zeckensack
02-27-2002, 12:47 PM
Originally posted by dutchstud:

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-100.0, 100.0, -100.0, 100.0, -100.0, 100.0);
is that right?


Straight from the GL specs:


void Frustum( double l, double r, double b, double t,double n, double f );
...
If either n or f is less than or equal to zero, l is equal to r, b is equal to t, or n is equal to f, the error INVALID VALUE results.


That means you still have an identity projection matrix.