我正在學習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