Jump to content

  • Log In with Google      Sign In   
  • Create Account

Moving the mouse


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Big_Al482   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 July 2001 - 01:53 PM

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

Sponsor:

#2 Alex5   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 July 2001 - 02:12 PM

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.

#3 TheBlackJester   Members   -  Reputation: 142

Like
Likes
Like

Posted 22 July 2001 - 02:24 PM

What you need to do is this. Set it up so that on every render, the mouse position is set back to 320,240 (if your in 640x480) so that the mouse is at the center of the screen on eace frame. Then it can''t go off the edge.

#4 Gilzu   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 July 2001 - 08:50 PM

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

#5 jwalker   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 July 2001 - 10:25 PM

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 !! }




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS