Archived

This topic is now archived and is closed to further replies.

Big_Al482

Moving the mouse

Recommended Posts

I made a fullscreen app in opengl where the mouse controls the camera''s orientation. The problem is, the camera''s rotation is limited to where the mouse moves on the screen, so when the mouse gets to the edge, the user can''t look in that direction anymore. Does anyone know how to move the mouse on the screen so that when it gets to one side you can reposition it back to the center or something? Thanks

Share this post


Link to post
Share on other sites
I am assuming that you are getting mouse input from the windows messages (that''s what it sounds like at least).

Probably one of the best ways to get the mouse input is through DirectInput. It isn''t a hard interface to learn at all and as mouse input, it will give you info describing how far the mouse has moved relative to the last time you checked, rather than it''s specific screen coordinate. I think this would help you a lot.

If you want me to give you some easy code to intialize and use DirectInput to get mouse data, reply or e-mail me.

Share this post


Link to post
Share on other sites
do you know the 3dmax interface?

once you drag the mouse, lets say bottomwise, and it reaches to
the bottom edge, then the interface "jumps" the mouse to the top
of the screen, so you can keep dragging the mouse bottomwise
and the mouse will keep "falling".
if you worry about the user watching the mouse do that, and
you want the mouse to look as if it stands in the middle of
the screen, just hide the mouse, and draw a pseudo one standing
stilt at the center of the screen while the user do the drag.
one he gets out of the drag mode, mouse return to himself

Gil

Share this post


Link to post
Share on other sites
try using directinput and setting the input mode to be axis based .. i think its the default.

then you wont have an end to the mouse scope ..

if you move to the right , the X will be positive.
if you move to the left , the X will be negative.

that should solve your problem .



{ Stating the obvious never helped any situation !! }

Share this post


Link to post
Share on other sites