Re: [PyOpenGL-Users] Problems creating a simple 3D engine
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@ro...> - 2004-11-11 21:47:11
|
soul wrote: ... >I mean "moving cursor to the center of the window" :-P. Sorry! My is not >very good. I'm trying to implement a mouse view like 3th person games >and i need to hold mouse in center of my application window to do >this. > >I know how to get mouse position using GLUT but i don't know how to set >mouse coords. Can you explain me? > > I think you are probably looking for something like what you see in this: *set_visible * pygame.mouse.set_visible(bool) -> bool Shows or hides the mouse cursor. This will return the previous visible state of the mouse cursor. Note that when the cursor is hidden and the application has grabbed the input. pygame will force the mouse to stay in the center of the screen. Since the mouse is hidden it won't matter that it's not moving, but it will keep the mouse from the edges of the screen so the relative mouse position will always be true. which seems tailor-made for what I gather you're trying to do (i.e. create a Quake/Doom style navigation mechanism, where you draw something in the center of the screen and pretend that's the mouse cursor, and moving the mouse moves the head of the avatar to change what you're looking at). Don't know of a similar mechanism under wxPython or GLUT, but I'd guess *someone* has written them at some point. HTH, Mike ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |