Mr.Freeze
07-08-2001, 09:13 PM
Hello,
I would like to get the depth information of the central pixel of my window so that I can make some smart rotations around the object which is in the middle of my screen.
I try doing it with:
GLfloat pixel[1];
glReadPixels (windowXSize/2,windowYSize/2,1,1,GL_DEPTH_COMPONENT,GL_FLOAT,pixel);
but this doesn't work. The value of pixel doesn't change except when the object is very very close. I checked that GL_DEPTH_SCALE is 1 and GL_DEPTH_BIAS is 0.
What do I do wrong?
Thanks for your help http://www.opengl.org/discussion_boards/ubb/smile.gif
I would like to get the depth information of the central pixel of my window so that I can make some smart rotations around the object which is in the middle of my screen.
I try doing it with:
GLfloat pixel[1];
glReadPixels (windowXSize/2,windowYSize/2,1,1,GL_DEPTH_COMPONENT,GL_FLOAT,pixel);
but this doesn't work. The value of pixel doesn't change except when the object is very very close. I checked that GL_DEPTH_SCALE is 1 and GL_DEPTH_BIAS is 0.
What do I do wrong?
Thanks for your help http://www.opengl.org/discussion_boards/ubb/smile.gif