How can I get the camera to rotate by using the mouse (using GLUT). I have tried using the glutMotionFunc(); But it seems to only give positive values, because it rotates the camera just fine, however it only rotates in the positive direction regardless of whether I move my mouse left or right. I have also tried the glutMouseFunc();, which seems to work perfectly, however it only updates the motion when I click my mouse.
Also, how can I get this to work without having to click.
However, I have one more question. glutPassiveMotionFunc only detects mouse position to the window borders. Is there a way to still detect mouse motion past the window border?
With the following functions, you can get the mouse changes, however you should write an extra code to rotate and move the camera.
void repositionMouse(float& deltaMouseX, float& deltaMouseY)
{
int x = glutGet(GLUT_WINDOW_X);
int y = glutGet(GLUT_WINDOW_Y);
int width = glutGet(GLUT_WINDOW_WIDTH);
int height = glutGet(GLUT_WINDOW_HEIGHT);