Precision of gluUnproject

Anyone can tell me the precision of gluUnproject? I find the return values of the function are not so precise, especially when you rotate, scale the image(I did not try translation). Is there anyone who has the similar expenence? Or it is the problem of my program?

Most OpenGL hardware use float (32 bits) for all vertices and normals.

But it may also be the z values, this depends on the depth buffer resolution, and this in turn depends on the near/far clipping plane ratio.

Mikael

Thanks a lot!
I change my z-buffer depth from 8 bits to 32 bits, it makes obvious improvement, but it is still not perfect. I also change the near/far clipping ratio, no matter increase or decrease, it makes no improvement. Any new suggestions?

Originally posted by mikael_aronsson:
[b]Most OpenGL hardware use float (32 bits) for all vertices and normals.

But it may also be the z values, this depends on the depth buffer resolution, and this in turn depends on the near/far clipping plane ratio.

Mikael[/b]

[This message has been edited by Rong Yao (edited 01-30-2004).]

gluUnProject is specifically designed to function between depth values of 0.0 and 1.0.
If you need more resolution, then adjust the depth field with glDepthRange(GLclampd near, GLclampd far), and use gluUnProject4().

It’s designed to handle depth coordinates outside 0.0 - 1.0

Hope that helps

Thanks! Which library should I use for
gluUnProject4()? It looks like my current compiler does not like it.

Originally posted by McWare:
[b]gluUnProject is specifically designed to function between depth values of 0.0 and 1.0.
If you need more resolution, then adjust the depth field with glDepthRange(GLclampd near, GLclampd far), and use gluUnProject4().

It’s designed to handle depth coordinates outside 0.0 - 1.0

Hope that helps[/b]