X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=6d47393250a084c9a7075613fa8c04882d1cd8a1;hp=4514e794fd95e161a3cc03d8aff00adb41559c83;hb=5e6a932345dfe95c3d2b289053b93abfb5c5d4fb;hpb=c211ae308b321f2988f4caa28cb828bd68308700 diff --git a/scene.c b/scene.c index 4514e79..6d47393 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 @@ -110,8 +110,8 @@ 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); + manipulateState = STATE_OBJECT_POSITION_SCALE; glutPostRedisplay(); } @@ -299,21 +299,28 @@ 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)*leftrightFactor; } else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) { // w: big/small, h: up/down + float scaling = (y - starty)*bigsmallFactor; + sceneObjs[curObject].scale[0] += scaling; + sceneObjs[curObject].scale[1] += scaling; + sceneObjs[curObject].scale[2] += scaling; } + + 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;