X-Git-Url: http://git.treefish.org/~alex/seamulator.git/blobdiff_plain/444591b1b4dcd7ea0fa37b6db29ac20d4722a72c..c3490f1ce9931b4050db4d4e0f044cf61285e2c6:/seamulator.cpp?ds=sidebyside diff --git a/seamulator.cpp b/seamulator.cpp index 92567f8..3d6a539 100644 --- a/seamulator.cpp +++ b/seamulator.cpp @@ -118,13 +118,15 @@ void glMouseFunc(int button, int state, int x, int y) void glMotionFunc(int x, int y) { - view.lookAlt = fmod(view.oldLookAlt + - (float)((y-view.fstMouseAngle[1])*2*M_PI/glutGet(GLUT_WINDOW_HEIGHT)), - (float)(2*M_PI)); - - view.lookAz = fmod(view.oldLookAz + - (float)((x-view.fstMouseAngle[0])*2*M_PI/glutGet(GLUT_WINDOW_WIDTH)), - (float)(2*M_PI)); + view.lookAlt = + fmod(view.oldLookAlt + + (float)((y-view.fstMouseAngle[1])*2*M_PI/glutGet(GLUT_WINDOW_HEIGHT)), + (float)(2*M_PI)); + + view.lookAz = + fmod(view.oldLookAz + + (float)((x-view.fstMouseAngle[0])*2*M_PI/glutGet(GLUT_WINDOW_WIDTH)), + (float)(2*M_PI)); updateView(); }