Hi,
OS: Windows NT.
I am trying to verify our (3d)raycaster output by comparing the bounding box of our rendered output with OpenGl output image’s bounding box. I need this checking only for verifying if our “perspective projection” is fine.
For simplicity consider I have a cube of (256x256x256) having same intensity, rotated by -20 degrees about z axis and being displayed in a window(in our program) I need program in OpenGL which does the same and which can give me bounding box of the 2d output image. I was successful in creating cube in OpenGL and displaying with ortho projection.
- but setting the size of the cube to 256x256x256 in OpenGL is not known to me. How do I do that? Curently I use glBegin(GL_QUADS) …;…; for all 6 sides of the cube. Looks like glVertex3f only takes in normalised values w.r.t windows. I need to set the size of the cube exactly!
*Also rotating about z axis by -20 degrees. I tried using glRotatef(-20, 0, 0,1); Is this right?
*I have my nearVal, farVal and fieldOfView for setting the perspective projection… I currently use ortho projection in OpenGL. How do I set perspective projection.
Thanks for any hints or help.