X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=d1c7cf21a912592862cf3ef6e1b0523b5d52857f;hp=fe67e1395e4e8f3a710e1fad549f0c1af57e8ce5;hb=02a8a651d1897a11d266dcd93d27b7f1d4c03a84;hpb=4bcc8e39f5d73c7b210a48d3ca4dcd53ed8fb37e;ds=sidebyside diff --git a/scene.c b/scene.c index fe67e13..d1c7cf2 100644 --- a/scene.c +++ b/scene.c @@ -187,11 +187,11 @@ void windowReshape(int w, int h) { glMatrixMode(GL_PROJECTION); glLoadIdentity(); if (w <= h) - glFrustum(-1.0, 1.0, -1.0*(GLfloat) h / (GLfloat) w, - 1.0*(GLfloat) h / (GLfloat) w, 2.0, 10.0); + glFrustum(-near, far, -near*(GLfloat) h / (GLfloat) w, + far*(GLfloat) h / (GLfloat) w, nearClip, farClip); else - glFrustum(-1.0*(GLfloat) w / (GLfloat) h, - 1.0*(GLfloat) w / (GLfloat) h, -1.0, 1.0, 2.0, 10.0); + glFrustum(-near*(GLfloat) w / (GLfloat) h, + far*(GLfloat) w / (GLfloat) h, near, far, nearClip, farClip); glMatrixMode(GL_MODELVIEW); } @@ -399,13 +399,13 @@ int main(int argc, char **argv) { glLineWidth(1.0); // **NOTE: Currently the perspective and look-at code is static, for testing purposes - glMatrixMode(GL_PROJECTION); - gluPerspective( - 40.0, /* field of view in degree */ - 1.0, /* aspect ratio */ - 1.0, /* Z near */ // **NOTE: Seems to be issue with near < 0 causing invisible everything - 100.0 /* Z far */ - ); + //glMatrixMode(GL_PROJECTION); + //gluPerspective( + // 40.0, /* field of view in degree */ + // 1.0, /* aspect ratio */ + // 1.0, /* Z near */ // **NOTE: Seems to be issue with near < 0 causing invisible everything + // 100.0 /* Z far */ + // ); glMatrixMode(GL_MODELVIEW); gluLookAt(