as soon as specify z coordinate, line dissapears

Hi,

I have the following code segment:

glBegin(GL_LINE_STRIP);

glColor3f(1.0,0.0,1.0);
glVertex3f( 400.0, 100.0,0.0);
glVertex3f(450.0,100.0,0.0);
glEnd();

Thta works fine, but as soon as I put a z-coordinate value other than 0, nothing appears on the screen.
Is it something to do with the setup?

thanks,

Sumit

How do you setup your projection and modelview matrices? You are likely going behind the far clip plane or in front of the near clip plane.

Or your Camera is in front of the line!

Originally posted by mphanke:
Or your Camera is in front of the line!

Well then he would also be in front of the near clip plane, now wouldn’t he?

Anyway, just as a FYI, sroy e-mailed me some of his setup code, and I think his problem is that he is actually going outside the viewing frustum to the top right. He originally had an Orthographic view that had a left & right clip area of 0-500, and he’s now trying to use a perspective view. You’ll note above that his x/y coordinates are 400, 100, which would need to be pushed WAY back in order to be in a typical frustum viewing volume. Hopefully some of the code I mailed him helps explain where the viewing volume is with a perspective view.

Probably the depth test is GL_EQUAL or something…