Thursday, 5 September 2013

OpenGL gluPerspective Issues, No Display

OpenGL gluPerspective Issues, No Display

I'm having trouble going from the explanation of gluPerspective found
here:
http://unspecified.wordpress.com/2012/06/21/calculating-the-gluperspective-matrix-and-other-opengl-matrix-maths/
to the actual input parameters needed for the function.
I have a cube that I'm displaying stuff in. The coordinates of the cube
range from -10 to 10 in every direction.
Can someone give me an example of the gluPerspective() call needed to
display that region? I've tried gluPerspective(26,w/h,10,30) thinking that
the angle of 26 degrees is in the angle from the focal point (10 units
from the box) to the middle of the box's top side, which means I have 10
units to the close edge and 30 to the far. However when I change from
glOrtho(-10.0f, 10.0f, -10.0f, 10.0f, -10.0f, 10.0f); to
gluPerspective(...) nothing is displayed on the screen.

No comments:

Post a Comment