X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=73e04ee54289719aea1130d1fd9e3d174eb38408;hp=ce50dd251ae05d036de6f3415c16949d801d78e2;hb=306ea5fbd16870427a441b947c4d700f3a7147de;hpb=3cebf2b382dc558220f394351ce8df48367dffc8 diff --git a/scene.c b/scene.c index ce50dd2..73e04ee 100644 --- a/scene.c +++ b/scene.c @@ -556,24 +556,21 @@ motion(int x, int y) void idle() { angle = (int)(angle + 10) % 360; - //angle2 = (int)(angle2 + 10) % 360; - printf("Angle 1: %f, Angle 2: %f\n", angle, angle2); - sleep(25); - glutPostRedisplay(); + //angle2 = (int)(angle2 + 10) % 360; + printf("Angle 1: %f, Angle 2: %f\n", angle, angle2); + sleep(1); + glutPostRedisplay(); } -int drawFloorRecurse = 3; +int drawFloorRecurse = 5; void drawSquare(int recurseLevel, float x1, float y1, float x2, float y2) { - printf("%d, %d, %d, %d\n", x1, y2, x2, y2); - if ( drawFloorRecurse != recurseLevel ) { float xm = (x1 + x2) / 2.0; float ym = (y1 + y2) / 2.0; int rnew = recurseLevel + 1; - printf("Recursing to level %d\n", rnew); // Split into four sub-quads drawSquare(rnew, x1, y1, xm, ym); @@ -582,7 +579,6 @@ void drawSquare(int recurseLevel, float x1, float y1, float x2, float y2) { drawSquare(rnew, xm, y1, x2, ym); } else { - printf("Drawing (%.10f, %.10f) -> (%.10f, %.10f)\n", x1, y2, x2, y2); glBegin(GL_QUADS); glVertex3f(x1, 0.0, y1); glVertex3f(x1, 0.0, y2);