X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=c6ef084cdaf2b73bbc9b41a99a6d22b777cdae81;hp=e3004ee8d6450eb1e2966d9e8172a4911dcbbf9a;hb=86cadef4c5a94d3eeecd3f18b70b6a2e1cae555e;hpb=25283b277b8404716b19fd41eb537568e7f9ef35 diff --git a/scene.c b/scene.c index e3004ee..c6ef084 100644 --- a/scene.c +++ b/scene.c @@ -132,6 +132,8 @@ GLfloat angle2 = 30; /* in degrees */ GLfloat near = -10; GLfloat far = 10; +static float zoomFactor = 1.0; + /** * Prints out error message when file cannot be read * @param fileName Name of file that could not be read @@ -491,11 +493,11 @@ void windowReshape(int w, int h) { glMatrixMode(GL_PROJECTION); glLoadIdentity(); if (w <= h) - glOrtho(near, far, near*(GLfloat)h/(GLfloat)w, - far*(GLfloat)h/(GLfloat)w, near, far); + glOrtho(zoomFactor*near, zoomFactor*far, zoomFactor*near*(GLfloat)h/(GLfloat)w, + zoomFactor*far*(GLfloat)h/(GLfloat)w, near, far); else - glOrtho(near*(GLfloat)w/(GLfloat)h, - far*(GLfloat)w/(GLfloat)h, near, far, near, far); + glOrtho(zoomFactor*near*(GLfloat)w/(GLfloat)h, + zoomFactor*far*(GLfloat)w/(GLfloat)h, zoomFactor*near, zoomFactor*far, near, far); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); }