我正在学习 OpenGL 并且遇到了 gluPerspective 的问题。这是我在 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);
我的场景工作正常.. 但只要我稍微远离我的物体,它们就会消失(如图像中的红球)。:
我从中获取图表的网络
我知道红球不在视野范围内,不会显示。所以我想要的是增加它停止绘制的距离。我尝试增加 3000.0f 但不起作用!
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height, 0.5f, 3000000.0f);
所以我的问题是:如何增加openGL停止绘制对象的距离?