From: Ash Tyndall Date: Tue, 18 Oct 2011 12:52:04 +0000 (+0800) Subject: (no commit message) X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=commitdiff_plain;h=28eeb90dc1735bfcbebbe76ed64ce6f49cb512c0 --- diff --git a/scene.c b/scene.c index e08b667..e5d2a17 100644 --- a/scene.c +++ b/scene.c @@ -489,10 +489,12 @@ void makeMenu() { * @param h New height */ void windowReshape(int w, int h) { - zoomFactor = zoomFactor - 1; glViewport(0, 0, (GLsizei) w, (GLsizei) h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); + GLfloat x = 2.0f*(200 + 0.5)/w-1.0; + GLfloat y = 2.0f*(200 + 0.5)/h-1.0; + glTranslatef(-x,-y,0.0f); if (w <= h) glOrtho(zoomFactor*near, zoomFactor*far, zoomFactor*near*(GLfloat)h/(GLfloat)w, zoomFactor*far*(GLfloat)h/(GLfloat)w, near, far);