PDA

View Full Version : Clipping volume???

08-25-2000, 11:00 PM
gluOrtho...

I want to know what the last two parameters

mean.(near,far)

If I want to know the accurate depth value,

how do i set the near and far value?

The larger the difference of near and far is,
Is the depth value the more accurate???

zed
08-26-2000, 02:31 AM
this is prolly discused in the faq http://www.frii.com/~martz/oglfaq/ but basically u want to push the near plane out as far as possible

zed
08-26-2000, 02:34 AM
this is prolly discused in the faq http://www.frii.com/~martz/oglfaq/ but basically u want to push the near plane out as far as possible
i should mention to get an acuarate near/far planes just measure the distances of all your objects in the scene and use the nearest one to the camera minus its bounding sphere as a near plane and the furtherest as a far plane

Bob
08-26-2000, 06:32 AM
The less the distance between the far plane and the near plane, the more precision you get. Think about it, a larger distance between the planes means a larger distance between each possible combination of the number in the depthbuffer.

A near plane at 0 and a far plane at 64000 will end up in approx. one unit of space for each combination in a 16-bit depthbuffer. If you instead place the far plane at 128000, you will have 2 units of space between each combination (=worse precision).

So, to sum it, keep the distance as small as possible. And remember, it's the RELATIVE distance that matters.