(no commit message)
authorAsh Tyndall <[email protected]>
Tue, 18 Oct 2011 12:48:49 +0000 (20:48 +0800)
committerAsh Tyndall <[email protected]>
Tue, 18 Oct 2011 12:48:49 +0000 (20:48 +0800)
scene.c

diff --git a/scene.c b/scene.c
index e3004ee..c6ef084 100644 (file)
--- a/scene.c
+++ b/scene.c
@@ -132,6 +132,8 @@ GLfloat angle2 = 30;   /* in degrees */
 GLfloat near = -10;\r
 GLfloat far = 10;\r
 \r
+static float zoomFactor = 1.0;\r
+\r
 /**\r
  * Prints out error message when file cannot be read\r
  * @param fileName Name of file that could not be read\r
@@ -491,11 +493,11 @@ void windowReshape(int w, int h) {
   glMatrixMode(GL_PROJECTION);\r
   glLoadIdentity();\r
   if (w <= h) \r
-    glOrtho(near, far, near*(GLfloat)h/(GLfloat)w,\r
-             far*(GLfloat)h/(GLfloat)w, near, far);\r
+    glOrtho(zoomFactor*near, zoomFactor*far, zoomFactor*near*(GLfloat)h/(GLfloat)w,\r
+             zoomFactor*far*(GLfloat)h/(GLfloat)w, near, far);\r
   else\r
-    glOrtho(near*(GLfloat)w/(GLfloat)h,\r
-             far*(GLfloat)w/(GLfloat)h, near, far, near, far);\r
+    glOrtho(zoomFactor*near*(GLfloat)w/(GLfloat)h,\r
+             zoomFactor*far*(GLfloat)w/(GLfloat)h, zoomFactor*near, zoomFactor*far, near, far);\r
    glMatrixMode(GL_MODELVIEW); \r
    glLoadIdentity();\r
 }\r

UCC git Repository :: git.ucc.asn.au