X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=c650c057dc9db23128a1c7de063239157a8f406b;hp=cf969764d25b892d4d766b92d800c07819d656be;hb=55bfed85b24a4fe5471d3fca580e3b86cd74e21d;hpb=bf419bc7b47235edddd11094230ed0f02cf5d8c7 diff --git a/scene.c b/scene.c index cf96976..c650c05 100644 --- a/scene.c +++ b/scene.c @@ -110,7 +110,6 @@ void processLightEvents(int id) { * @param id ID of object selected */ void processObjectEvents(int id) { - // **NOTE: For the testing phase, only have the teapot addSceneObject(id); glutPostRedisplay(); } @@ -120,7 +119,10 @@ void processObjectEvents(int id) { * @param id ID of texutre selected */ void processTextureEvents(int id) { - + if ( curObject >= 0 ) { + sceneObjs[curObject].texture = id; + glutPostRedisplay(); + } } /** @@ -168,7 +170,7 @@ void makeMenu() { glutAddMenuEntry("Position/Scale", M_POSITION_SCALE); glutAddMenuEntry("Rotation/Texture Scale", M_ROTATION_TEXTURE_SCALE); //glutAddSubMenu("Material", materialMenu); - //glutAddSubMenu("Texture", textureMenu); + glutAddSubMenu("Texture", textureMenu); glutAddSubMenu("Ground texture", gTextureMenu); //glutAddSubMenu("Lights", lightMenu); glutAddMenuEntry("Exit", M_EXIT); @@ -390,13 +392,13 @@ void display() { SceneObject so = sceneObjs[i]; // Apply rotation vector - //glRotatef(so.rotation.amount, so.rotation.vector[0], so.rotation.vector[1], so.rotation.vector[2]); + glRotatef(so.rotation.amount, so.rotation.vector[0], so.rotation.vector[1], so.rotation.vector[2]); // Apply scaling vector - //glScalef(so.scale[0], so.scale[1], so.scale[2]); + glScalef(so.scale[0], so.scale[1], so.scale[2]); // Apply translation vector - //glTranslatef(so.x, so.y, so.z); + glTranslatef(so.x, so.y, so.z); // Apply texture if ( so.texture > 0 ) {