X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=helper.c;h=8135854e751bdd83c6c4f770ab6480ffa2a71e00;hp=441b3c9b22bb4b75bde312ae57a0d321a34c1270;hb=5b211bce232b1e75aa7cd3a08c533a8dd446f2fa;hpb=821c28d874f5560d63a57ed73bc77b11337c3280 diff --git a/helper.c b/helper.c index 441b3c9..8135854 100644 --- a/helper.c +++ b/helper.c @@ -355,12 +355,32 @@ void updateLights() { // Draw light ball for light glPushMatrix(); - glColor3f(1.0, 1.0, 1.0); + glColor3f(0.0, 1.0, 1.0); glTranslatef(lightObjs[i].position[0], lightObjs[i].position[1], lightObjs[i].position[2]); - glutSolidSphere(lightBallSize, 20, 20); + glutSolidSphere(lightBallSize, 20, 20);; glPopMatrix(); } glEnable(GL_LIGHTING); +} + +/** + * Sets variables to the state they are in to begin with. + */ +void initializeState() { + /* Initial light 0 position. */ + lightObjs[0].position[0] = 4; + lightObjs[0].position[1] = 5; + lightObjs[0].position[2] = 6; + lightObjs[0].position[3] = 0.0; + + /* Initial light 1 position. */ + lightObjs[1].position[0] = -4; + lightObjs[1].position[1] = 5; + lightObjs[1].position[2] = -6; + lightObjs[1].position[3] = 0.0; + + /* Initial floor texture */ + currentGroundTexture = 5; } \ No newline at end of file