/* Zoom and rotate tracking */
GLfloat zoom = 0.0, rotate = 0.0, camAngle = 40.0;
GLfloat zoomFactor = 0.2, rotateFactor = 0.5, camAngleFactor = 0.5;
-GLfloat leftrightFactor = 0.5, nearfarFactor = 0.5, bigsmallFactor = 0.2, updownFactor = 0.5;
+GLfloat leftrightFactor = 0.5, nearfarFactor = 0.5, bigsmallFactor = 0.05, updownFactor = 0.5;
/* Beginning width, height */
int width = 500, height = 500;
//sceneObjs[curObject].x += (x - startx)*leftrightFactor;\r
} else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) {\r
// w: big/small, h: up/down\r
- float scaling = (y - starty);//*bigsmallFactor;\r
+\r
+ // For big/small scaling, we map negative numbers to 0->1 and positive numbers to 1->inf\r
+ float diff = (y - starty);\r
+ float scaling;\r
+\r
+ if ( scaling < 0 ) {\r
+ scaling = (x - -height)/(0 - -height);\r
+ } else {\r
+ scaling = diff;\r
+ }\r
+ \r
printf("Scaling by %f on all axii\n", scaling);\r
sceneObjs[curObject].scale[0] += scaling;\r
sceneObjs[curObject].scale[1] += scaling;\r