From: Ash Tyndall Date: Thu, 20 Oct 2011 03:34:15 +0000 (+0800) Subject: (no commit message) X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=a8892e6dc7feb8282b95681498b6931cdbe0f2da;p=atyndall%2Fcits2231.git --- diff --git a/scene.c b/scene.c index 95c19c5..260169d 100644 --- a/scene.c +++ b/scene.c @@ -186,13 +186,19 @@ void windowReshape(int w, int h) { glViewport(0, 0, (GLsizei) w, (GLsizei) h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); - if (w <= h) + gluPerspective( + 60.0, /* field of view in degree */ + 1.0, /* aspect ratio */ + nearClip, /* Z near */ + farClip /* Z far */ + ); + /*if (w <= h) glOrtho(near, far, near*(GLfloat)h/(GLfloat)w, far*(GLfloat)h/(GLfloat)w, -100, 100); else glOrtho(near*(GLfloat)w/(GLfloat)h, far*(GLfloat)w/(GLfloat)h, near, far, nearClip, farClip); - glMatrixMode(GL_MODELVIEW); + glMatrixMode(GL_MODELVIEW); */ glLoadIdentity(); } @@ -311,13 +317,6 @@ void init() { glMatrixMode(GL_PROJECTION); glLoadIdentity(); - gluPerspective( - 60.0, /* field of view in degree */ - 1.0, /* aspect ratio */ - near, /* Z near */ - far /* Z far */ - ); - glLightfv(GL_LIGHT0, GL_POSITION, light0_pos); glLightfv(GL_LIGHT0, GL_AMBIENT, ambient0);