Using Spaceball devices with VMD
Beginning with version 1.8.7, VMD includes much broader support for consumer level Spaceball-like six-degree-of-freedom input devices such as the 3DConnexion SpaceNavigator.For the older Spaceball 2003/3003/4000 devices using serial ports, one can use either the vendor-provided commercial driver or the built-in VMD serial driver. The VMD built-in driver is activated by setting the VMDSPACEBALLPORT environment variable on Linux/Unix/MacOS X. The built-in driver interface is documented in the VMD User's Guide. The built-in serial driver is based on John Stone's LibSBall library.
For the newer 3DConnexion devices like the SpacePilot, SpaceNavigator, etc, VMD uses the commercial drivers provided by 3DConnexion, and the devices are automatically detected and supported on all of the VMD platforms. Another option besides the commercial drivers, which is particularly useful on Linux distributions that 3DConnexion doesn't support well, one can also use the open-source "spacenavd" driver, which acts as a drop-in replacement for the commercial driver.
VMD now includes a "spaceball" command, which implements the following capabilities:
spaceball modevalid modes are: normal -- Full 6DOF motion control of the scene. In Perspective display projection mode, forces applied to the ball/puck are reflected in the orientation and position of the molecule. In Orthographic display projection mode, forward/back translations of the ball/puck result in scaling rather than translation since translation in Z is not easily visible in orthographic mode. maxaxis -- Limited DOF motion control. Only translate/rotate on the axis with the largest force input. This mode is best used when one only wants to alter the position or orientation of the molecule in one axis at a time. scale -- Scale the molecule/scene animate -- Use the Spaceball as a jog/shuttle control for trajectory playback. tracker -- Use the console Spaceball as a VMD tracker, much as one would use a haptic device. This is done by adding two lines to your ~/.vmdsensors file as below: device SpaceballTracker sballtracker://local/vmdlocal device SpaceballButtons sballbuttons://local/vmdlocal With that done, you can open the Graphics->Tools menu, and either manually create a grab tool, and add the spaceball tracker as the position device, and the spaceball buttons as the button device, etc. I'm still working on the button controls here, but you can try it out and see what you think presently. user -- This emits events for use by Tcl scripts via callbacks, an example script is shown below: proc do_spaceball_client { args } { global vmd_spaceball puts "Spaceball event: $vmd_spaceball" } trace add variable vmd_spaceball write do_spaceball_client spaceball mode user There are also two commands that configure the 'feel' of the device: The 'spaceball sensitivity' command sets the scaling factors that translate the user-applied forces on the device to corresponding rotation/translations in VMD. The default sensitivity is "1.0", with my internal implementation having lots of magic speed factors that I determined by trial and error. This sensitivity value is a global sensitivity scaling factor. Internally, I have many others, but I'll only expose them as user commands if people really feel the need to tweak this in more detail. For starters we'll see how a single scaling factor works out. Heres' an example: spaceball sensitivity 1.0 The 'spaceball nullregion' command sets the force magnitude below which VMD simply ignores the input and does act on it. If you have a device that likes to wander by itself or you find that the slightest touch already causes motion on the display, you can set this value higher. The default value I'm using presently is 16, which should be quite reasonable. Here's an example: spaceball nullregion 16