X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=2bf72a3c2682013c0238c32df5a3f37227df68cc;hp=84892823545bf75017da008d186e4cd1580d5433;hb=d238df40acc4f9075c327032e9b9749823dc9b34;hpb=92fbf793e39627632747a84aeaf9653e13fdb8e3 diff --git a/scene.c b/scene.c index 8489282..2bf72a3 100644 --- a/scene.c +++ b/scene.c @@ -129,7 +129,8 @@ void processTextureEvents(int id) { * @param id ID of ground texture selected */ void processGTextureEvents(int id) { - + currentGroundTexture = id; + glutPostRedisplay(); } /** @@ -169,7 +170,7 @@ void makeMenu() { //glutAddMenuEntry("Rotation/Texture Scale", M_ROTATION_TEXTURE_SCALE); //glutAddSubMenu("Material", materialMenu); //glutAddSubMenu("Texture", textureMenu); - //glutAddSubMenu("Ground texture", gTextureMenu); + glutAddSubMenu("Ground texture", gTextureMenu); //glutAddSubMenu("Lights", lightMenu); glutAddMenuEntry("Exit", M_EXIT); @@ -318,7 +319,7 @@ void display() { 75.0, aspect, 0.1, - 200 + 300 ); glMatrixMode(GL_MODELVIEW); @@ -355,8 +356,6 @@ void display() { glLightfv(GL_LIGHT1, GL_POSITION, lightPosition1); drawFloor(); - - drawLine(); // Draw teapot for a test object glPushMatrix(); @@ -370,21 +369,23 @@ void display() { // Draw a white ball over the light source glPushMatrix(); glDisable(GL_LIGHTING); - glColor3f(0.0, 0.0, 0.0); + glColor3f(1.0, 1.0, 1.0); glTranslatef(lightPosition0[0], lightPosition0[1], lightPosition0[2]); - glutSolidSphere(0.3, 50, 50); + glutSolidSphere(0.5, 50, 50); glEnable(GL_LIGHTING); glPopMatrix(); // Draw a white ball over the light source glPushMatrix(); glDisable(GL_LIGHTING); - glColor3f(0.0, 0.0, 0.0); + glColor3f(1.0, 1.0, 1.0); glTranslatef(lightPosition1[0], lightPosition1[1], lightPosition1[2]); - glutSolidSphere(0.3, 50, 50); + glutSolidSphere(0.5, 50, 50); glEnable(GL_LIGHTING); glPopMatrix(); + drawAxisLines(); + glPopMatrix(); glutSwapBuffers(); @@ -417,7 +418,7 @@ void init() { glMaterialf(GL_FRONT, GL_SHININESS, shine); glEnable(GL_LIGHT0); - glEnable(GL_LIGHT1); + //glEnable(GL_LIGHT1); glEnable(GL_LIGHTING); } @@ -453,7 +454,7 @@ int main(int argc, char **argv) { glEnable(GL_DEPTH_TEST); // Enables Depth Testing glDepthFunc(GL_LEQUAL); // the type glEnable(GL_TEXTURE_2D); - glEnable(GL_CULL_FACE); + //glEnable(GL_CULL_FACE); glEnable(GL_NORMALIZE); glLineWidth(2.0);