X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=e5d2a172a92a29f7c790b2897f7de19fe30822bd;hp=496203791a666a4b516989012844e795ce976b1c;hb=2a3932dad3ec48310af0b3c3cbb7685fc6105b03;hpb=1bacda10b9d25b0403fc1a4ee0514372e2932bfa diff --git a/scene.c b/scene.c index 4962037..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);