From 241ec710cf9e36891031b23e5bad89beb20c0944 Mon Sep 17 00:00:00 2001 From: Ash Tyndall Date: Fri, 21 Oct 2011 08:25:04 +0800 Subject: [PATCH 1/1] --- scene.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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); -- 2.20.1