• Advertisement

Archived

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

GLUT Mouse Interaction

This topic is 6063 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''d like to get relative coordinates for the mouse each frame instead of absolute, as GLUT seems to give. The problem is that using the mouse for mouse look, when the mouse cursor reaches the edge of the screen, the camera won''t look in that direction any further, so I need a workaround. I''m trying to do this completely platform-independent, so somebody help me out please Thanks in advance! Hope this post wasn''t too unclear hehe

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
GLUT gives relative coordinates in respect to the window. After each reading and updating of your variables can you reset the pointer to the center. Take a look at NeHe tutorial 23 for an example.

Share this post


Link to post
Share on other sites
Thanks for the quick reply, but this isn''t quite what I''m looking for... I meant relative coordinates as in relative to the previous frame, not relative to the window. I would use Directinput, but I don''t want to use anything Win32-specific, I''m trying to be completely platform-independent, at least as much as possible. I know a simple SetCursorPos(x,y) would work for Windows, but I want it to be platform-independent, so I''m trying to avoid that. E.g. if you move the mouse left 2 pixels from the last frame, you would get (-2,0), as opposed to (468,234) or whatever the new cursor position is. The other thing that might help would be a setcursorpos() function equivalent in GLUT... thanks in advance, hope someone knows the answer.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
glutWarpPointer or similar.
Cool name sounds like Star Trek.

Share this post


Link to post
Share on other sites
Thanks a lot for your help, that''s exactly what I was looking for : )

Share this post


Link to post
Share on other sites

  • Advertisement