gluPerspective is "centered" on lower left corner. i want it in the center

i’m using opengl 4 on windows 8.

When i call gluPerspective, the focus or center of the view seems to be in the corner rather than the center. this is depicted in the following link to an image:

(add http in front and replace all * with . to get it working)

On the left side is how a wireframe cube would look if i used gluPerspective. The view is centered on the lower left corner.

On the right side is how i want the cube to look. The view is centered on the center, and all edges of the cube are visible.

how can i do this?

Please supply some code

my post was denied for some reason involving urls and forbidden words
instead, here is a link to my code and explanation. link was modified in the same way as the image was as descriped in the first post. thank you


gluPerspective in GL_MODELVIEW

gluPerspective should not be used with the view-model matrix. It defines the projection. The view-model matrix defines the position of the cameras and objects in the world. You uses gluLookAt to position the camera.
You might want to look at OpenGL Transformation

i understand. however, i cannot get gluPerspective to work in GL_PROJECTION. (the resulting display is the same as if i left the gluPerspective line out completely. do you have any idea why this might be the case?

That doesn’t make any sense but have a read of it might help solve your problem

Also make sure window.clear and world.draw aren’t changing anything

i’ve got it working with this now:

def display():   

def reshape():
    glShadeModel( GL_FLAT )
    gluPerspective(120., window.width / float(window.height), .1, 1000.)