X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=8ce005bade04a86858131ec1ddd995dd027dc1bb;hp=b0268832e2149bc5f11b0e6cbcfb9f7319d2b30d;hb=9ef3cb688ee424d11b9b9549ec3cb3dac29334c4;hpb=71f65a8fdceed0f4ae289fe99ec013d2edd76ae3;ds=sidebyside diff --git a/scene.c b/scene.c index b026883..8ce005b 100644 --- a/scene.c +++ b/scene.c @@ -226,7 +226,7 @@ void mouse(int button, int state, int x, int y) { } } -void keyboard(unsigned char key, int x, int y) { +void keyboard(unsigned char key, int x1, int y1) { switch(key) { case 'w': z = z - 1; @@ -279,11 +279,13 @@ void display() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); gluLookAt( - x, y, z, /* eye is at (x,y,z) */ + 0.0, 0.0, 10.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 */ ); + glTranslatef(x, y, z); + // **NOTE: Currently this rotation function is all that moves the camera off // the flat surface. Need to integrate function into gluLookAt glRotatef(30.0, 1.0, 0.0, 0.0);