【发布时间】:2011-07-15 03:02:17
【问题描述】:
我正在学习 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);
我的场景工作正常.. 但只要我稍微远离我的对象,它们就会消失(如图像中的红球)。 :Web where I took graph from
我了解红球不在视线范围内,不会显示。所以我想要的是增加它停止绘制的距离。我尝试增加 3000.0f 但不起作用!。
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height, 0.5f, 3000000.0f);
所以我的问题是:如何增加 openGL 停止绘制对象的距离?
【问题讨论】:
-
我花了很多时间在谷歌上搜索,找到了很多信息(如webcache.googleusercontent.com/…),但我不完全理解为什么不工作以及我应该怎么做。请记住,我正在学习 OpenGL。