How can I know the distance when an object is disappeared?

When i zoom out an object in an OGL view, this object will disappear at a certain distance suddenly.Because this object is so big, when it disappears it even occupies 1/5 of the view.I don’t want the object to disappear so suddenly, and want it to disappear when it’s much smaller.

What shall i do?

Thanks.

Objects are clipped at the near clip plane in OpenGL. Look at your glFrustum call or the equivalent.

It looks like doing nothing.
I’ve add glFrustum to Function"InitGL" as below.

int COpenGLWindow::InitGL(void)
{
glColor4f(0.2f, 1.0f, 0.2f, 0.0f);
glBlendFunc(GL_SRC_ALPHA, GL_ONE); glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL);
//////////////////////////////
glFrustum(-1.0, 1.0, -1.0, 1.0, 0.0, 900.0);
//////////////////////////////
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); glLightfv(GL_LIGHT0, GL_AMBIENT, LightAmbient);
glLightfv(GL_LIGHT0, GL_DIFFUSE, LightDiffuse);
glLightfv(GL_LIGHT0, GL_SPECULAR, LightSpecular);
glLightfv(GL_LIGHT0, GL_POSITION, LightPosition);
glEnable(GL_LIGHT0);
glEnable(GL_LIGHTING);
return true;
}

[This message has been edited by Attach (edited 03-05-2004).]

Originally posted by Attach:
[b]When i zoom out an object in an OGL view, this object will disappear at a certain distance suddenly.Because this object is so big, when it disappears it even occupies 1/5 of the view.I don’t want the object to disappear so suddenly, and want it to disappear when it’s much smaller.

What shall i do?

Thanks.[/b]

you want to modify your far clipping plane. the far clipping plane is the distance into the screen at which your objects are clipped. it seems that your far clipping plane has to shallow a value for your app.

Your near clip plane should not be set to zero. Make sure that your near clip plane is pushed out a ways. Try 1.0 at least in your case, but push it out more if you can get away with it. This is very important for features like fog and zbuffering.