From 71241448babc5f4f732cdd37a6278c4fe4a70102 Mon Sep 17 00:00:00 2001 From: Ash Tyndall Date: Fri, 21 Oct 2011 09:29:01 +0800 Subject: [PATCH 1/1] --- scene.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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); -- 2.20.1