GLUT Mouse Interaction
Started by Corfe, Jun 16 2001 03:37 PM
4 replies to this topic
#1 Members - Reputation: 136
Posted 16 June 2001 - 03:37 PM
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
Sponsor:
#2 Anonymous Poster_Anonymous Poster_* Guests - Reputation:
Posted 17 June 2001 - 06:12 AM
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.
#3 Members - Reputation: 136
Posted 17 June 2001 - 08:20 AM
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.
#4 Anonymous Poster_Anonymous Poster_* Guests - Reputation:
Posted 17 June 2001 - 08:26 AM
glutWarpPointer or similar.
Cool name sounds like Star Trek.
Cool name sounds like Star Trek.






