This plug-in provides support for the 3Dconnexion 3D mouse line of products (SpaceNavigator, SpaceMouse, SpacePilot).
A full sample script can be found at \examples\devices\spaceNavigatorExample.py.
The 3Dconnexion plug-in is implemented as a Vizard extension, with the following methods/constants:
Method | Description |
<connexion>.addDevice() | Returns the 3Dconnextion device sensor |
<connexion>.DOMINANT_TRANSLATE | Dominant axis filter flag for filtering translations to axis with largest motion. |
<connexion>.DOMINANT_ROTATE | Dominant axis filter flag for filtering rotations to axis with largest motion. |
<connexion>.DOMINANT_ALL | Dominant axis filter flag for filtering translations and rotations to axis with largest motion. |
The 3Dconnexion device object contains the following methods, in addition to the standard extension sensor methods:
Method | Description |
<device>.getRawTranslation() | Get the raw instantaneous translation amount of the device [x,y,z]. |
<device>.getRawRotation() | Get the raw instantaneous rotation amount of the device [rx,ry,rz], about each axis. |
<device>.getFilteredTranslation() | Get the filtered instantaneous translation amount of the device [x,y,z]. |
<device>.getFilteredRotation() | Get the filtered instantaneous rotation amount of the device [rx,ry,rz], about each axis. |
<device>.setTranslateScale(scale) |
Set the [x,y,z] scale factor for translation movement. The default scale is 1. |
<device>.getTranslateScale() | Get the [x,y,z] scale factor for translation movement. |
<device>.setRotateScale(scale) | Set the [x,y,z] scale factor for rotation movement. The default scale is 1. |
<device>.getRotateScale() | Get the [x,y,z] scale factor for rotation movement. |
<device>.setDominantAxisFilter(flags) |
Set the dominant axis filter flags. Can be a combination of the following flags: <connexion>.DOMINANT_TRANSLATE <connexion>.DOMINANT_ROTATE <connexion>.DOMINANT_ALL |
<device>.getDominantAxisFilter() | Get the dominant axis filter flags. |
<device>.reset() | Reset the accumulated position and orientation to zero. |
The position and orientation of the 3Dconnexion device is automatically accumulated based on the raw movement and the specified translate/rotate scale factors. The device position and orientation can be manually set using the setPosition/setEuler commands.
The following code shows how to use add a 3Dconnexion device and link the movement to the viewpoint:
The following code shows how to limit the device rotation about the Y axis:
The following code shows how to use the raw translation/rotation values to manually move the viewpoint: