View Full Version : Mouse view changing

06-13-2005, 09:45 AM
Hi I have a first person program where I can walk and look around, but I use the keys to do this right now, but what I want to do is make it so I can use the mouse instead. I know how to use glutPassiveFunc() and all, but when I run my program it jumps to much, I want it to be smooth, here is the code for my mouse.

void pmouse(int x, int y)
view.look += ((float)x/100-1)/2;
}in my display function I have glutWarpPointer(100,100); to place the pointer back at 100,100. I would have liked to put in my passive function, but it didn't work there.

here is the code that does work for my keys.

view.look -= 0.05*m_elapsedTime;
view.look += 0.05*m_elapsedTime;
}view is the variable for my camera and look() is the function that computes where I should be looking.

does anybody have any ideas?