X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=76b2880471a9b8acc4e0397c8eef2c072c6c7e58;hp=af2d52c398280e3013e2c948952161c5ef3bbb39;hb=c1ea046313919520b40b6142cd72c9e053e30f01;hpb=b0a8c04c993514d979c7bff6a56ad5e437ce38b9 diff --git a/scene.c b/scene.c index af2d52c..76b2880 100644 --- a/scene.c +++ b/scene.c @@ -291,8 +291,12 @@ void display() { glMatrixMode(GL_PROJECTION); glLoadIdentity(); - float aspect = (float)height / (float)width; - if ( width > height ) aspect = (float)width / (float)height; + float aspect; + if ( width <= height ) { + aspect = (float)height / (float)width; + } else { + aspect = (float)width / (float)height; + } gluPerspective( 75.0, @@ -321,7 +325,7 @@ void display() { glPushMatrix(); /* Perform scene rotations based on user mouse/keyboard input. */ - glRotatef(angle, 0.0, 0.0,1.0); + glRotatef(angle, 0.0, 1.0, 0.0); glRotatef(angle2, 1.0, 0.0, 0.0); glTranslatef(camx, camy, camz); glRotatef(rot, 1.0, 0.0, 0.0); @@ -409,6 +413,8 @@ int main(int argc, char **argv) { glEnable(GL_DEPTH_TEST); // Enables Depth Testing glDepthFunc(GL_LEQUAL); // the type glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + glFrontFace(GL_CW); glEnable(GL_TEXTURE_2D); glEnable(GL_NORMALIZE); glLineWidth(1.0);