After spending most of my time on GlowScript (glowscript.org) I’m now seriously working again on a wxPython version of VPython (vpython.org). This would eliminate having to maintain platform-dependent components in VPython for creating windows and OpenGL contexts, and would make feasible for the first time a Cocoa-based version on the Mac. I’m happy to report that I’m making rapid progress.
Both VPython (Python) and the similar GlowScript (JavaScript/CoffeeScript) provide an easy-to-use API for creating 3D animations. In VPython, dragging with the right mouse button (or dragging with Ctrl held down with a one-button mouse) rotates the camera around the 3D scene. Is there a way to “lock” the mouse during a rotate operation? That is, to make the mouse cursor position remain fixed during the rotation? I didn’t find anything about this in my documentation searches.
Both VPython (Python) and the similar GlowScript
(JavaScript/CoffeeScript) provide an easy-to-use API for creating 3D
animations. In VPython, dragging with the right mouse button (or
dragging with Ctrl held down with a one-button mouse) rotates the
camera around the 3D scene. Is there a way to "lock" the mouse during
a rotate operation? That is, to make the mouse cursor position remain
fixed during the rotation? I didn't find anything about this in my
documentation searches.
So, you want to receive mouse motion messages, but you want the pointer
to remain stationary?
There is no pretty way to do that. All of the operating systems assign
a high priority to keeping the motion of the mouse pointer synced with
the position of the physical mouse, because that is a key item of user
feedback. When the pointer stops moving, people tend to believe
(usually rightly!) that the computer has locked up.
You can come up with a close simulation, however. You certainly save
the pointer position and hide the pointer when you start your operation,
then keep forcing the mouse position back to the original location, then
reveal the pointer again when you are done.
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
I should have been more explicit. I do indeed intend to hide the
pointer. So to rephrase my question, how do I force the mouse position
back to the original location?
···
On Mon, Oct 22, 2012 at 11:01 AM, Tim Roberts <timr@probo.com> wrote:
There is no pretty way to do that. All of the operating systems assign
a high priority to keeping the motion of the mouse pointer synced with
the position of the physical mouse, because that is a key item of user
feedback. When the pointer stops moving, people tend to believe
(usually rightly!) that the computer has locked up.
You can come up with a close simulation, however. You certainly save
the pointer position and hide the pointer when you start your operation,
then keep forcing the mouse position back to the original location, then
reveal the pointer again when you are done.
I should have been more explicit. I do indeed intend to hide the
pointer. So to rephrase my question, how do I force the mouse position
back to the original location?
On Mon, Oct 22, 2012 at 10:24 AM, Bruce Sherwood <bruce.sherwood@gmail.com> wrote:
On Mon, Oct 22, 2012 at 11:01 AM, Tim Roberts <timr@probo.com> wrote:
There is no pretty way to do that. All of the operating systems assign
a high priority to keeping the motion of the mouse pointer synced with
the position of the physical mouse, because that is a key item of user
feedback. When the pointer stops moving, people tend to believe
(usually rightly!) that the computer has locked up.
You can come up with a close simulation, however. You certainly save
the pointer position and hide the pointer when you start your operation,
then keep forcing the mouse position back to the original location, then
reveal the pointer again when you are done.
On Mon, Oct 22, 2012 at 11:26 AM, Chris Weisiger <cweisiger@msg.ucsf.edu> wrote:
On Mon, Oct 22, 2012 at 10:24 AM, Bruce Sherwood > <bruce.sherwood@gmail.com> wrote:
I should have been more explicit. I do indeed intend to hide the
pointer. So to rephrase my question, how do I force the mouse position
back to the original location?