From: Ash Tyndall Date: Tue, 18 Oct 2011 03:30:56 +0000 (+0800) Subject: (no commit message) X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=79f4b6e1d83d5ec50cfac2f71487bd9d07d8fc8e;p=atyndall%2Fcits2231.git --- diff --git a/scene.c b/scene.c index e2d17e6..79c506e 100644 --- a/scene.c +++ b/scene.c @@ -534,19 +534,19 @@ void display() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); - glTranslatef( 0.0f, 0.0f, 0.0f); + /*glTranslatef( 0.0f, 0.0f, 0.0f); glBegin(GL_QUADS); glVertex3f( 0.0f, 1.0f, -1.0f); glVertex3f( 0.0f, 1.0f, 1.0f); glVertex3f( 0.0f, -1.0f, 1.0f); glVertex3f( 0.0f, -1.0f, -1.0f); - glEnd(); + glEnd();*/ glTranslatef( 0.0f, 0.0f, -5.0f); // Move into the Screen 10.0 glutSolidTeapot(1); - /*glMatrixMode(GL_MODELVIEW); + /* glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(0.7f, 0.4f, 0.9f, -2.0f, -1.0f, -7.0f, 1.0f, 10.0f, 1.0f); @@ -608,5 +608,14 @@ int main(int argc, char **argv) { init(); + glMatrixMode(GL_PROJECTION); + gluPerspective( /* field of view in degree */ 40.0, + /* aspect ratio */ 1.0, + /* Z near */ 20.0, /* Z far */ 100.0); + glMatrixMode(GL_MODELVIEW); + gluLookAt(0.0, 8.0, 60.0, /* eye is at (0,8,60) */ + 0.0, 8.0, 0.0, /* center is at (0,8,0) */ + 0.0, 1.0, 0.); /* up is in postivie Y direction */ + glutMainLoop(); }