Mouse movement
I have a 3D engine that uyses the cursor keys for movement. I now want to use the mouse, anyone know how to do this so that it has a Quake styled free-mouse movement, i.e you move the mouse up and the view moves up etc...
cheers
What API are you using? If you''re using DirectX, look into DirectInput, its simple as pie, and enables you to read the keyboard, mouse & joystick(s) present. If you''re not, well, the simplest way is to (sorry i''m assuming Win32 here) GetCursorPos(), and SetCursorPos()... get the cursor position, subtract the POINT structure''s x and y coordinates from the coordinates they were last frame, then reset the cursor to the centre of the screen. multiply it by a variable for different sensitivitys...
Insomnia
Insomnia
Insomnia
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement