/* Zoom and rotate tracking */
GLfloat zoom = 0.0, rotate = 0.0, camAngle = 40.0;
GLfloat zoomFactor = 0.2, camRotateFactor = 0.5, camAngleFactor = 0.5;
-GLfloat leftrightFactor = 0.5, nearfarFactor = 0.5, bigsmallFactor = 0.6, updownFactor = 0.03, rotateFactor = 0.8, texscaleFactor = 0.5;
+GLfloat leftrightFactor = 0.5, nearfarFactor = 0.5, bigsmallFactor = 0.6, updownFactor = 0.03, rotateFactor = 0.8, texscaleFactor = 0.05;
/* Beginning width, height */
int width = 500, height = 500;
if ( buttonSelected == GLUT_LEFT_BUTTON ) {\r
// w: left/right, h: near/far\r
\r
- // **NOTE: Currently a work in progress\r
+ // **NOTE: Currently a work in progress, does not work correctly\r
printf("cam angle: %f\n", rotate*camRotateFactor);\r
sceneObjs[curObject].x += diffx * sin(rotate*camRotateFactor);\r
sceneObjs[curObject].z += diffx * cos(rotate*camRotateFactor);\r
break;\r
\r
case STATE_OBJECT_ROTATION_TEXTURE_SCALE:\r
+\r
if ( buttonSelected == GLUT_LEFT_BUTTON ) {\r
// w: rotate on y\r
sceneObjs[curObject].rotation.y += diffx * rotateFactor;\r
+\r
// h: rotate on x\r
sceneObjs[curObject].rotation.x += diffy * rotateFactor;\r
+\r
} else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) {\r
// w: rotate on x\r
sceneObjs[curObject].rotation.x += diffx * rotateFactor;\r
+\r
// h: texture scale\r
float max = (float)height/texscaleFactor;\r
float scaling = (diffy + max) / max;\r
sceneObjs[curObject].texture.scale *= scaling;\r
+\r
}\r
+ \r
break;\r
\r
}\r