X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=a307bc808cf02ca5cc8d46b7cd29db706f738183;hp=3c25623b0741b460ad6918b4975799a7faa7c161;hb=4af8d4ec288e6d3bc09c2d2ac2da19330e6dda34;hpb=ec80d8ef3d8a350840e9b04a37c6b1ee09270a05 diff --git a/scene.c b/scene.c index 3c25623..a307bc8 100644 --- a/scene.c +++ b/scene.c @@ -184,15 +184,7 @@ void makeMenu() { */ void windowReshape(int w, int h) { glViewport(0, 0, (GLsizei) w, (GLsizei) h); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - if (w <= h) - glFrustum(-near, far, -near*(GLfloat) h / (GLfloat) w, - far*(GLfloat) h / (GLfloat) w, nearClip, farClip); - else - glFrustum(-near*(GLfloat) w / (GLfloat) h, - far*(GLfloat) w / (GLfloat) h, near, far, nearClip, farClip); - glMatrixMode(GL_MODELVIEW); + printf("I am called!\n"); } /** @@ -296,11 +288,11 @@ void display() { glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - gluLookAt( - 30.0, 30.0, 30.0, /* eye is at (x,y,z) */ - 0.0, 0.0, 0.0, /* center is at (x,y,z) */ - 0.0, 1.0, 0.0 /* up is in postivie Y direction */ - ); + //gluLookAt( + // -30.0, -30.0, -30.0, /* eye is at (x,y,z) */ + /// 0.0, 0.0, 0.0, /* center is at (x,y,z) */ + // 0.0, 1.0, 0.0 /* up is in postivie Y direction */ + // ); /* Reposition the light source. */ lightPosition[0] = 12*cos(lightAngle); @@ -357,11 +349,11 @@ void init() { glLightModelfv(GL_LIGHT_MODEL_AMBIENT, glightmodel); - glMaterialfv(GL_FRONT, GL_AMBIENT, ambient); - glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse); - glMaterialfv(GL_FRONT, GL_SPECULAR, specular); - glMaterialfv(GL_FRONT, GL_EMISSION, emission0); - glMaterialf(GL_FRONT, GL_SHININESS, shine); + glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, ambient); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse); + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specular); + glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, emission0); + glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, shine); glEnable(GL_LIGHT0); glEnable(GL_LIGHTING);