PDA

View Full Version : how to use mouse control the roam?



ruixp
11-20-2001, 06:29 PM
thanks,marcus256 and ares


[This message has been edited by ruixp (edited 11-21-2001).]

marcus256
11-21-2001, 04:49 AM
Check out http://opengl.freehosting.net/glfw

You can use glfwGetMousePos(&x,&y), and then use the x-values for "turning" information and the y-values for motion information.

The better approach is usually the famous "mouse-look" method: mouse x controls turning, mouse y controls "look up/down", and then use the keyboard for movement (forward/back and left/right ("strafe")).

ARES
11-21-2001, 10:28 AM
In your WindowProc you can also check for the WM_MOUSEMOVE message that gets called when the mouse moves. The LOWORD of lParam is the x and the HIWORD of lParam is the y coord of the mouse.

You can also use

POINT mouse;
GetCursorPos( &mouse );

to get the mouse position.