X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=4514e794fd95e161a3cc03d8aff00adb41559c83;hp=0251439ca2796b485987d7a6ecc6a3f7552e6151;hb=c211ae308b321f2988f4caa28cb828bd68308700;hpb=2931dc8f8168076f7cceed66414ad44969bf9e4b diff --git a/scene.c b/scene.c index 0251439..4514e79 100644 --- a/scene.c +++ b/scene.c @@ -120,7 +120,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 +171,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 +393,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]); // Apply translation vector - //glTranslatef(so.x, so.y, so.z); + glTranslatef(so.x, so.y, so.z); // Apply texture if ( so.texture > 0 ) {