From: Ash Tyndall Date: Fri, 21 Oct 2011 01:29:01 +0000 (+0800) Subject: (no commit message) X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=commitdiff_plain;h=71241448babc5f4f732cdd37a6278c4fe4a70102 --- diff --git a/scene.c b/scene.c index 9b4db15..230901a 100644 --- a/scene.c +++ b/scene.c @@ -291,7 +291,12 @@ void display() { glMatrixMode(GL_PROJECTION); glLoadIdentity(); - float aspect = (float)width / (float)height; + float aspect; + if ( width <= height ) { + aspect = (float)height / (float)width; + } else { + aspect = (float)width / (float)height; + } gluPerspective( 75.0, @@ -407,7 +412,7 @@ 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);