我正在学习OpenGL,并与gluPerspective有问题。下面是我使用的代码中的init()如何增加openGL停止绘制对象的距离(zfar/gluPerspective)?
// 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);
我的现场作品的权利..但只要我去一点点远离我的对象,他们dissapear(如图像的红球)。 : Web where I took graph from
我知道红球在视野之外,不会显示。所以我想要的是增加它停止绘制的距离。我试图增加3000.0f,但不工作!
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height, 0.5f, 3000000.0f);
所以我的问题是:我怎样才能提高距离openGL的地方停绘图对象?
我花了很多谷歌搜索,发现了很多信息(如http://webcache.googleusercontent.com/search?q=cache:-rnJ929O4dgJ:www.sjbaker.org/steve/omniv/love_your_z_buffer.html+ http://www.sjbaker.org/steve/omniv/love_your_z_buffer.html&cd=1&hl=zh-CN&ct=clnk&gl=uk&source=www.google.co.uk),但我不完全理解为什么不工作,我应该怎么做它。请记住我正在学习OpenGL。 – 2011-03-14 15:43:43