X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=scene.c;h=230901a347bc271213ccbf891d28d4de6ea6bd86;hb=71241448babc5f4f732cdd37a6278c4fe4a70102;hp=f7dbd40079cd81f71f90d493853304fecd8b1f25;hpb=a020144e3c81b827e06abee630979965c24a707d;p=atyndall%2Fcits2231.git diff --git a/scene.c b/scene.c index f7dbd40..230901a 100644 --- a/scene.c +++ b/scene.c @@ -291,11 +291,15 @@ 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, 200 @@ -408,8 +412,9 @@ 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_CULL_FACE); glEnable(GL_TEXTURE_2D); + glEnable(GL_NORMALIZE); glLineWidth(1.0); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);