X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=80c1ee982ab653a99b7e28308edc05cc22dfd49b;hp=95c19c5a4775e45f407d11b3a13a4dd8ab1cc485;hb=e7a92d3985b360bcb688de9976d1adcfae5de583;hpb=98a2cb8985b63cd318709aecb70fe6a83a97419a diff --git a/scene.c b/scene.c index 95c19c5..80c1ee9 100644 --- a/scene.c +++ b/scene.c @@ -186,13 +186,19 @@ void windowReshape(int w, int h) { glViewport(0, 0, (GLsizei) w, (GLsizei) h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); - if (w <= h) + gluPerspective( + 60.0, /* field of view in degree */ + 1.0, /* aspect ratio */ + nearClip, /* Z near */ + farClip /* Z far */ + ); + /*if (w <= h) glOrtho(near, far, near*(GLfloat)h/(GLfloat)w, far*(GLfloat)h/(GLfloat)w, -100, 100); else glOrtho(near*(GLfloat)w/(GLfloat)h, far*(GLfloat)w/(GLfloat)h, near, far, nearClip, farClip); - glMatrixMode(GL_MODELVIEW); + glMatrixMode(GL_MODELVIEW); */ glLoadIdentity(); } @@ -259,6 +265,12 @@ void display() { 0.0, 0.0, 0.0, /* center is at (x,y,z) */ 0.0, 1.0, 0.0 /* up is in postivie Y direction */ ); + gluPerspective( + 60.0, /* field of view in degree */ + 1.0, /* aspect ratio */ + nearClip, /* Z near */ + farClip /* Z far */ + ); // **NOTE: Currently this rotation function is all that moves the camera off @@ -311,13 +323,6 @@ void init() { glMatrixMode(GL_PROJECTION); glLoadIdentity(); - gluPerspective( - 60.0, /* field of view in degree */ - 1.0, /* aspect ratio */ - near, /* Z near */ - far /* Z far */ - ); - glLightfv(GL_LIGHT0, GL_POSITION, light0_pos); glLightfv(GL_LIGHT0, GL_AMBIENT, ambient0);