I am using freeglut, and have a simple 3-D model (it is just a cube) that I can display on my screen. I am trying to obtain the depth map of this cube given the current coordinates and orientation of the camera and display the depth map on some window.
Is this possible? If so, how?