X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=81c5b562361e52da32384c9c6e0cee3dafcf7389;hp=aa26ba1c695b89eeedf65e7f58faf18465e27223;hb=e4ce2f6ee4857a66d2f9845c5dc10e35b80f3946;hpb=c3f151c018e143e5505a2c13f3ab876fd5b0a67f diff --git a/scene.c b/scene.c index aa26ba1..81c5b56 100644 --- a/scene.c +++ b/scene.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "bitmap.h" @@ -508,7 +509,7 @@ void windowReshape(int w, int h) { */ /*void mouse(int btn, int state, int x, int y) { -}*/ +}*//* static void mouse(int button, int state, int x, int y) { @@ -551,8 +552,15 @@ motion(int x, int y) lightStartY = y; glutPostRedisplay(); } -} +}*/ +void idle() { + angle = (int)(angle + 10) % 360; + //angle2 = (int)(angle2 + 10) % 360; + printf("Angle 1: %d, Angle 2: %d", angle, angle2); + sleep(2); + glutPostRedisplay(); +} /** * Draw a floor. @@ -614,9 +622,8 @@ void display() { glPushMatrix(); - //glTranslatef(0.0, 0.0, 0.0); - - glutSolidTeapot(30); // Draw teapot for test + glTranslatef(0.0, 0.0, 0.0); + glutWireTeapot(30); // Draw teapot for test glPopMatrix(); glPushMatrix(); @@ -645,7 +652,7 @@ void init() { gluPerspective( 60.0, /* field of view in degree */ 1.0, /* aspect ratio */ - -900.0, /* Z near */ + 0.0, /* Z near */ 900.0 /* Z far */ ); @@ -692,14 +699,15 @@ int main(int argc, char **argv) { glDepthFunc(GL_LEQUAL); // the type glEnable(GL_CULL_FACE); glEnable(GL_TEXTURE_2D); - glLineWidth(3.0); + glLineWidth(1.0); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); glutReshapeFunc(windowReshape); glutDisplayFunc(display); - glutMouseFunc(mouse); - glutMotionFunc(motion); + //glutMouseFunc(mouse); + //glutMotionFunc(motion); + glutIdleFunc(idle); makeMenu();