I am learning OpenGL and having 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 works right.. but as soon as I go a little bit away from my objects they dissapear (As the red balls in image). :
Web where I took graph from
I understand that red balls are outside of view and won't be shown. So what I want is to increase the distance where it stops drawing. I tried increasing 3000.0f but is not working!.
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height, 0.5f, 3000000.0f);
So my question is : How can I increase distance where openGL stops drawing objects?