How to increase the distance (zfar / gluPerspective) where openGL stops drawing objects?

I am learning OpenGL and have a problem with gluPerspective. Here is the code I use in Init ()

// Calculate The Aspect Ratio Of The Window
// The parameters are:
// (view angle, aspect ration of the width to the height, 
//  The closest distance to the camera before it clips, 
// FOV, Ratio,  The farthest distance before it stops drawing)
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height, 0.5f, 3000.0f);

My scene is working correctly ... but as soon as I move a little away from my objects, they disappear (like red balls in the image) .: Frustrum exampleWeb, where I took the graph from

I understand that red balls are out of sight and will not be shown. Therefore, I want to increase the distance at which he stops drawing. I tried to increase 3000.0f but it does not work!

    gluPerspective(45.0f,(GLfloat)width/(GLfloat)height, 0.5f, 3000000.0f);

So my question is: How to increase the distance where openGL stops drawing objects?

Some photos about the problem: Pic1 Pic2

+3
source share
2

, , , :

zfar . , , ( ) - skybox. Skybox . pic2 !

, , skybox. zfar, !

+4

. , . , , , ( ).

3000.0f 10000.0f, . ?

? , , .

+3

All Articles