(no commit message)
[atyndall/cits2231.git] / scene.c
diff --git a/scene.c b/scene.c
index c6ef084..e5d2a17 100644 (file)
--- a/scene.c
+++ b/scene.c
@@ -492,6 +492,9 @@ void windowReshape(int w, int h) {
   glViewport(0, 0, (GLsizei) w, (GLsizei) h);\r
   glMatrixMode(GL_PROJECTION);\r
   glLoadIdentity();\r
+  GLfloat x = 2.0f*(200 + 0.5)/w-1.0;\r
+  GLfloat y = 2.0f*(200 + 0.5)/h-1.0;\r
+  glTranslatef(-x,-y,0.0f);\r
   if (w <= h) \r
     glOrtho(zoomFactor*near, zoomFactor*far, zoomFactor*near*(GLfloat)h/(GLfloat)w,\r
              zoomFactor*far*(GLfloat)h/(GLfloat)w, near, far);\r

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