(no commit message)
authorAsh Tyndall <[email protected]>
Thu, 20 Oct 2011 03:34:15 +0000 (11:34 +0800)
committerAsh Tyndall <[email protected]>
Thu, 20 Oct 2011 03:34:15 +0000 (11:34 +0800)
scene.c

diff --git a/scene.c b/scene.c
index 95c19c5..260169d 100644 (file)
--- a/scene.c
+++ b/scene.c
@@ -186,13 +186,19 @@ void windowReshape(int w, int h) {
   glViewport(0, 0, (GLsizei) w, (GLsizei) h);\r
   glMatrixMode(GL_PROJECTION);\r
   glLoadIdentity();\r
   glViewport(0, 0, (GLsizei) w, (GLsizei) h);\r
   glMatrixMode(GL_PROJECTION);\r
   glLoadIdentity();\r
-  if (w <= h) \r
+    gluPerspective(\r
+    60.0,  /* field of view in degree */\r
+     1.0,  /* aspect ratio */\r
+    nearClip,  /* Z near */\r
+     farClip   /* Z far */\r
+    );\r
+  /*if (w <= h)\r
     glOrtho(near, far, near*(GLfloat)h/(GLfloat)w,\r
              far*(GLfloat)h/(GLfloat)w, -100, 100);\r
   else\r
     glOrtho(near*(GLfloat)w/(GLfloat)h,\r
              far*(GLfloat)w/(GLfloat)h, near, far, nearClip, farClip);\r
     glOrtho(near, far, near*(GLfloat)h/(GLfloat)w,\r
              far*(GLfloat)h/(GLfloat)w, -100, 100);\r
   else\r
     glOrtho(near*(GLfloat)w/(GLfloat)h,\r
              far*(GLfloat)w/(GLfloat)h, near, far, nearClip, farClip);\r
-   glMatrixMode(GL_MODELVIEW); \r
+   glMatrixMode(GL_MODELVIEW); */\r
    glLoadIdentity();\r
 }\r
 \r
    glLoadIdentity();\r
 }\r
 \r
@@ -311,13 +317,6 @@ void init() {
   glMatrixMode(GL_PROJECTION);\r
   glLoadIdentity();\r
 \r
   glMatrixMode(GL_PROJECTION);\r
   glLoadIdentity();\r
 \r
-  gluPerspective(\r
-    60.0,  /* field of view in degree */\r
-     1.0,  /* aspect ratio */\r
-    near,  /* Z near */\r
-     far   /* Z far */\r
-    );\r
-\r
   \r
   glLightfv(GL_LIGHT0, GL_POSITION, light0_pos);\r
   glLightfv(GL_LIGHT0, GL_AMBIENT, ambient0);\r
   \r
   glLightfv(GL_LIGHT0, GL_POSITION, light0_pos);\r
   glLightfv(GL_LIGHT0, GL_AMBIENT, ambient0);\r

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