\r
if ( buttonSelected == GLUT_LEFT_BUTTON ) {\r
// w: left/right, h: near/far\r
\r
if ( buttonSelected == GLUT_LEFT_BUTTON ) {\r
// w: left/right, h: near/far\r
-\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
+ float angler = 2 * M_PI * ( (rotate*camRotateFactor)/360.0 );\r
+ sceneObjs[curObject].x += diffx * cos(angler) * leftrightFactor + diffy * cos(M_PI/2 + angler) * nearfarFactor;\r
+ sceneObjs[curObject].z += diffx * sin(angler) * leftrightFactor + diffy * sin(M_PI/2 + angler) * nearfarFactor;\r
// Apply independant rotation vectors\r
glRotatef(so.rotation.x, 1.0, 0.0, 0.0);\r
glRotatef(so.rotation.y, 0.0, 1.0, 0.0);\r
// Apply independant rotation vectors\r
glRotatef(so.rotation.x, 1.0, 0.0, 0.0);\r
glRotatef(so.rotation.y, 0.0, 1.0, 0.0);\r
// Apply scaling vector\r
glScalef(so.scale[0], so.scale[1], so.scale[2]);\r
\r
// Apply scaling vector\r
glScalef(so.scale[0], so.scale[1], so.scale[2]);\r
\r