View Full Version : Infinite mouse rotation
hi,
i currently develop with an openGL engine
my problem is how to have an infinite rotation for the mouse : when the mouse reaches the border of the screen this wont rotate anymore my 3d view
i have tried to set the cursor position after a rotation, but .. this rotates back to the previous position my 3d engine
any clue welcome
Sol_HSA
07-04-2007, 01:50 AM
You need to capture the mouse and track the mouse relative motion instead of absolute position..
when i rotate my camera i do so with a relative position to calculate the angle of rotation
my main problem is that when i reach the border of the screen i have no more rotation of the mouse, its position is stucked
is there any way to declare to windows you want your mouse to move unbound ?
Sol_HSA
07-04-2007, 02:08 AM
If you're using SDL, it does all that for you, and you can just check the relative positions.
If not, I don't remember if windows returns relative positions somehow..
One workaround is to move the mouse cursor to the center of the screen on each frame, but that's not too neat =)
yup i tried to move the mouse back on each move, but if i set the new mouse cursor position by using SetCursorPos this is considered as a new input by my 3D engine and so this rotates back my camera, gasp
ok found it, i simply avoid any callback from some mouse drag and then dont care about the boomerang effect, i just pickup on each refresh the current mouse pos, rotate my camera considering the delta with the original mouse position (i get it when i click down the mouse) and reposition my mouse then. finaly easy. thanks for your inputs Sol_HSA :)
vBulletin, Copyright ©2000-2010, Jelsoft Enterprises Ltd.