I’am trying to fix my camera to the mouse so that when I move the mouse left, the view is rotated to the left and vice-versa (as in any 1st person shooter).
I am using GLUT glutPassiveMotionFunc() to achieve that. I look at dx and dy (x - oldx and y - oldy) and perform a rotation on my camera based on that. The problem is that when the mouse exits the window, the glutPassiveMotionFunc() don’t seems to be called and with no dx and dy, I can’t continue my camera rotation as well as I can’t rotate 360 degrees on myself.
Can anyone gives me some hint on a possible Glut implementation or on an other possible approach ??