coder2010
03-01-2010, 05:19 PM
Hi Guys,
Brand new to openGL and 3d stuff. I am still trying to wrap my head around a totaly new way of thinking. So please be gentle. I got a very newbee question. What would be the steps in openGL coding (from start to end in c++) to get depth buffer values. To make it simple I am trying to work only on a single triangle, i know the clipping planes, the camera location, looking at the origin and the up vector being -z axis.
Now i have gone as far as this:
glMatrixMode(GL_MODELVIEW);
glLookAt(..);
gluProject(..);
glFrustrum(..);
glViewPort(..);
I think these are the right steps. I am not sure what would be calls after this to get to glReadPixels(..).
One of my freinds suggested I use gluProject/gluUnproject. but that seems to include some of the functionality of these above calls built into it. Also, I think I would learn better if I know each function call individually so that I know what they do. Once I understand how to get this done with individual calls I can use the gluProject I guess.
Please, any help will be appreciated. I know I just did a very crude representation of my problem. I you would like I can post all the data that I have.
HELP...
Brand new to openGL and 3d stuff. I am still trying to wrap my head around a totaly new way of thinking. So please be gentle. I got a very newbee question. What would be the steps in openGL coding (from start to end in c++) to get depth buffer values. To make it simple I am trying to work only on a single triangle, i know the clipping planes, the camera location, looking at the origin and the up vector being -z axis.
Now i have gone as far as this:
glMatrixMode(GL_MODELVIEW);
glLookAt(..);
gluProject(..);
glFrustrum(..);
glViewPort(..);
I think these are the right steps. I am not sure what would be calls after this to get to glReadPixels(..).
One of my freinds suggested I use gluProject/gluUnproject. but that seems to include some of the functionality of these above calls built into it. Also, I think I would learn better if I know each function call individually so that I know what they do. Once I understand how to get this done with individual calls I can use the gluProject I guess.
Please, any help will be appreciated. I know I just did a very crude representation of my problem. I you would like I can post all the data that I have.
HELP...