From: Ash Tyndall Date: Sat, 22 Oct 2011 00:50:13 +0000 (+0800) Subject: (no commit message) X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=876a9341282f91027829f3e544ad4e4a7215c682;p=atyndall%2Fcits2231.git --- diff --git a/scene.c b/scene.c index c650c05..ffa63dd 100644 --- a/scene.c +++ b/scene.c @@ -1,6 +1,6 @@ /** * CITS2231 Graphics Scene Editor - * @author Ashley Tyndall (20915779) + * @author Ashley Tyndall (20915779), Jenna de la Harpe (20367932) */ #include @@ -111,6 +111,7 @@ void processLightEvents(int id) { */ void processObjectEvents(int id) { addSceneObject(id); + manipulateState = STATE_OBJECT_POSITION_SCALE; glutPostRedisplay(); } @@ -167,8 +168,8 @@ void makeMenu() { glutCreateMenu(processMainEvents); glutAddMenuEntry("Rotate/Move Camera", M_ROTATE_MOVE_CAMERA); glutAddSubMenu("Add object", objectMenu); - glutAddMenuEntry("Position/Scale", M_POSITION_SCALE); - glutAddMenuEntry("Rotation/Texture Scale", M_ROTATION_TEXTURE_SCALE); + //glutAddMenuEntry("Position/Scale", M_POSITION_SCALE); + //glutAddMenuEntry("Rotation/Texture Scale", M_ROTATION_TEXTURE_SCALE); //glutAddSubMenu("Material", materialMenu); glutAddSubMenu("Texture", textureMenu); glutAddSubMenu("Ground texture", gTextureMenu); @@ -298,21 +299,24 @@ void motion(int x, int y) { break; case STATE_OBJECT_POSITION_SCALE: - //SceneObject co = sceneObjs[curObject]; - + //so.x, so.y, so.z if ( buttonSelected == GLUT_LEFT_BUTTON ) { // w: left/right, h: near/far - + sceneObjs[curObject].x += (x - startx); } else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) { // w: big/small, h: up/down } + + startx = x; break; case STATE_OBJECT_ROTATION_TEXTURE_SCALE: if ( buttonSelected == GLUT_LEFT_BUTTON ) { // w: rotate on width, h: rotate on h + } else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) { - // w & h, rotate on h + // w: rotate on height, h: texture scale + } break;