X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=73e04ee54289719aea1130d1fd9e3d174eb38408;hp=6993bd4fb13708f2f84332eb691b71d13c88b5fc;hb=306ea5fbd16870427a441b947c4d700f3a7147de;hpb=a2f1c50d8985e2f043840ffea632fba446535a34 diff --git a/scene.c b/scene.c index 6993bd4..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 = 2; +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); @@ -614,7 +610,7 @@ void drawFloor() { glVertex3fv(floorVertices[3]); glEnd();*/ -drawSquare(0, -10.0, -10.0, 10.0, 10.0); +drawSquare(0, -1000.0, -1000.0, 1000.0, 1000.0); /*if (useTexture) { glDisable(GL_TEXTURE_2D);