From: Ash Tyndall Date: Fri, 21 Oct 2011 00:25:04 +0000 (+0800) Subject: (no commit message) X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=241ec710cf9e36891031b23e5bad89beb20c0944;p=atyndall%2Fcits2231.git --- diff --git a/scene.c b/scene.c index 99506e0..d06dd3c 100644 --- a/scene.c +++ b/scene.c @@ -293,8 +293,15 @@ void motion(int x, int y) { */ void display() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glMatrixMode(GL_MODELVIEW); glLoadIdentity(); + gluLookAt( + 0.0, 8.0, 30.0, /* eye is at (x,y,z) */ + 0.0, 0.0, 0.0, /* center is at (x,y,z) */ + 0.0, 1.0, 0.0 /* up is in postivie Y direction */ + ); + /* Reposition the light source. */ lightPosition[0] = 12*cos(lightAngle); lightPosition[1] = lightHeight; @@ -407,13 +414,6 @@ int main(int argc, char **argv) { // 100.0 /* Z far */ // ); - glMatrixMode(GL_MODELVIEW); - gluLookAt( - 0.0, 8.0, 30.0, /* eye is at (x,y,z) */ - 0.0, 0.0, 0.0, /* center is at (x,y,z) */ - 0.0, 1.0, 0.0 /* up is in postivie Y direction */ - ); - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); glutReshapeFunc(windowReshape);