X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=902e5991e7f50edacfa75e121c77e911c3fd9083;hp=31eff0e3ffdd3fdbf6f39e1606596f0928202ac0;hb=09c3124c81ac8607bcb0cdc8dcce79f08f8a1736;hpb=36aa202c760cb524f105a465007983f224cb97e3 diff --git a/scene.c b/scene.c index 31eff0e..902e599 100644 --- a/scene.c +++ b/scene.c @@ -25,17 +25,14 @@ void processMainEvents(int id) { switch (id) { case M_ROTATE_MOVE_CAMERA: - // Do stuff + manipulateState = STATE_CAMERA_ROTATE_MOVE; break; - case M_POSITION_SCALE: - // Do stuff + manipulateState = STATE_OBJECT_POSITION_SCALE; break; - case M_ROTATION_TEXTURE_SCALE: - // Do stuff + manipulateState = STATE_OBJECT_ROTATION_TEXTURE_SCALE; break; - case M_EXIT: exit(EXIT_SUCCESS); @@ -115,6 +112,7 @@ void processLightEvents(int id) { void processObjectEvents(int id) { // **NOTE: For the testing phase, only have the teapot addSceneObject(id); + glutPostRedisplay(); } /** @@ -165,10 +163,10 @@ void makeMenu() { // Construct main menu 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("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); //glutAddSubMenu("Material", materialMenu); //glutAddSubMenu("Texture", textureMenu); glutAddSubMenu("Ground texture", gTextureMenu); @@ -293,7 +291,6 @@ void motion(int x, int y) { } starty = y; - printf("zoom is %f, y is %d starty is %d\n", zoom, y, starty); startx = x; break; @@ -394,7 +391,8 @@ void display() { // Apply rotation vector vector* rv = so.rotation.vect; - glRotatef(so.rotation.parameter, *rv[0], *rv[1], *rv[2]); + printf("%f, %f, %f\n", *rv[0], *rv[1], *rv[2]); + /* glRotatef(so.rotation.parameter, *rv[0], *rv[1], *rv[2]); // Apply scaling vector vector* sv = so.scale; @@ -408,9 +406,8 @@ void display() { getTexture(so.texture); glBindTexture(GL_TEXTURE_2D, so.texture); } else { - getTexture(0); glBindTexture(GL_TEXTURE_2D, 0); - } + }*/ // Draw actual object if ( so.mesh > 0 ) {