X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=cb6fd4e7eca2bea194fe8f1604f867fb4570a9ba;hp=079433c9b26172f87f968e39e8db5de2dad97672;hb=9644796a64e902273a02a75c68e22da05b3a87ec;hpb=9630fcbe763ed8c935c60a44c0d8ace778383109 diff --git a/scene.c b/scene.c index 079433c..cb6fd4e 100644 --- a/scene.c +++ b/scene.c @@ -291,14 +291,18 @@ 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( - 90.0, + 75.0, aspect, 0.1, - 100 + 200 ); glMatrixMode(GL_MODELVIEW); @@ -310,7 +314,7 @@ void display() { 0.0, 1.0, 0.0 /* up is in postivie Y direction */ ); - glRotatef(45.0, 1.0, 0.0, 0.0); + glRotatef(75.0, 1.0, 0.0, 0.0); /* Reposition the light source. */ lightPosition[0] = 12*cos(lightAngle); @@ -408,8 +412,8 @@ int main(int argc, char **argv) { glDepthRange(0,1); glEnable(GL_DEPTH_TEST); // Enables Depth Testing glDepthFunc(GL_LEQUAL); // the type - glEnable(GL_CULL_FACE); glEnable(GL_TEXTURE_2D); + glEnable(GL_NORMALIZE); glLineWidth(1.0); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);