|03 March 2005||#1|
University Of Sheffield
Sheffield, United Kingdom
Join Date: Aug 2004
OpenGL Depth Problem
Hi, hope someone can help, I have a small problem in an application I am working on. The problem is the depth culling that openGL does. I need to use a larger frustum, as my object keeps dissapearing out of the back way too easily. I know it is possible to do this, and I've been studying the OpenGL Programming Guide, which recommends that I use either the lines:
gluPerspective(45.0f, 1.333f, 0.1f, 100.0f);
I have substituted into both of these some values I thought were appropriate, in the glFrustum() the values I worked out based on my distance from the monitor etc. and the gluPerspective() the values were pretty much taken from a NeHeGL tutorial program, where they seem to work fine. The problem I have is that with these lines in place my program only renders a black screen! Have I got some values wrong? Is there a way to just change the far plane of the frustum without arsing about with the rest? The project is to basically have a fish swimming around, but with the frustum as it is at the moment, there isn't really alot of space for the fish to swim in!
Thanks for your time
|03 March 2005||#2|
Join Date: Dec 2003
Generally you need to keep the range between the near and the far clipping plane relative small. So as you puch back the far clipping plane, you need to increase the near one as well a little bit. The distribution of the xDepth range tho is exponetial, because you need a greater accuracy close to the camera.
Some graphics cards have 8bits other have 16 for the zDepth. I was making a game using an ATI, and when I tried it out in a gForce, I freaked out cause all my objects were half visible.
I dont remember the syntax of the openGl functions... and the values are always relevant to your scene.
I am not sure if that will help you.
|03 March 2005||#3|
Join Date: Sep 2003
Thread automatically closed
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
|Thread Closed share thread|