View Full Version : how to use mouse control the roam?
11-20-2001, 06:29 PM
thanks,marcus256 and ares
[This message has been edited by ruixp (edited 11-21-2001).]
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")).
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
GetCursorPos( &mouse );
to get the mouse position.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.