PDA

View Full Version : Mouse movement



02-09-2003, 02:14 PM
How can I make the mouse move infinitly to a certain direction (so that it does not get stuck at the borders) and still be able to retrieve the coordinates.

I am going to use this for the view of the camera so when I move the mouse it must spin and spin and not getting stuck when the borders are reached.

shinpaughp
02-09-2003, 03:20 PM
Do not map the mouse coordinates directly to your rotation. Instead use an equation such that difference between cursorpos x or cursorpos y from center of window results in either a constant change in angle or small dist = small angular change, bigger dist = bigger angular change.

nexusone
02-09-2003, 03:38 PM
You can maped the mouse position.

Mouse is at center of screen no movement.

Mouse past X position, increase move++

Mouse below X position, decrease move--

Other option is with the mouse button.
mouse down read mouse until mouse up.

You have two variables, mouse down position and mouse up position.

mouse down position - mouse up position

If the result is negitive the move for forward if positive move was backwards.

Also you distance mouse traveled to get how much to move camera.

This help?


Originally posted by Muskov:
How can I make the mouse move infinitly to a certain direction (so that it does not get stuck at the borders) and still be able to retrieve the coordinates.

I am going to use this for the view of the camera so when I move the mouse it must spin and spin and not getting stuck when the borders are reached.

02-09-2003, 09:28 PM
aha that might work, thx!

mikael_aronsson
02-10-2003, 05:02 AM
Hi !

If you are using "drag" operations (mouse button down while moving mouse) you can do SetCapture() when the mouse button in pressed, this will continue to give you mouse events even when you move outside the window, just remember to call ReleaseCapture() when you are done.

Mikael