X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=d06dd3c3adca97d186b92b82f31de7ace8a43e16;hp=99506e0a5122d2e6bbfbe23156550cb9fc5d8690;hb=241ec710cf9e36891031b23e5bad89beb20c0944;hpb=e0726f60384f9ee752dbb78307e13be9a6ca7cf8 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);