3D Mouse

For more information: https://web.archive.org/web/20200731022623/https://www.3dconnexion.com/products/spacemouse.html#panel-whatis

Note: The following instructions have been tested and proven to work on the most basic model (Space Navigator).

From Wikipedia:3d mouse#3D mice:

Also known as bats, flying mice, or wands, these devices generally function through ultrasound and provide at least three degrees of freedom. Probably the best known example would be 3DConnexion/Logitech's SpaceMouse from the early 1990s.

Proprietary drivers

1. Plug your 3D mouse into your USB port. Use lsusb to check if it was recognised

$ lsusb
Bus 003 Device 002: ID 046d:c626 Logitech, Inc. 3Dconnexion Space Navigator 3D Mouse

2. Install openmotif.

3. Symlink libXm.so.4 to libXm.so.3

# ln -s /usr/lib/libXm.so.4 /usr/lib/libXm.so.3

4. The driver has some problems to get the username from /var/run/utmp and will output a "failed to get user" error.

To fix this problem compile the following program. It appends the given username to /var/run/utmp in such a way that the driver can read it.

3dmouse.c
/* source: http://forums.gentoo.org/viewtopic-t-609224.html
 *         http://www.3dconnexion.com/forum/viewtopic.php?t=1039
 */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <utmpx.h>

int main(int argc, char ** argv) {
  if (argc != 2) {
    fprintf(stderr, "Need a name to put in the structure\n");
    exit(1);
  }
  struct utmpx u;
  memset(&u, 0, sizeof(u));
  u.ut_type = USER_PROCESS;
  u.ut_pid = getpid();
  strcpy(u.ut_id, ":0");
  strcpy(u.ut_line, ":0");
  strcpy(u.ut_user, argv[1]);
  setutxent();
  pututxline(&u);
  endutxent();
} 

5. Download the linux drivers to from here: https://www.3dconnexion.com/service/drivers.html

6. Unpack the install script and run it NOTE: I chose not to run the driver everytime I login.

7. You can run the driver manually by calling it like this (for USB version):

8. You should now have a working 3D mouse in Arch Linux! You can test it by extracting the demos from the driver archive.

Open source drivers

There exists also an open source driver for 3Dconnexion devices maintained by the spacenav project. From the short list of softwares that supports spacenavd we can cite:

  • Blender
  • Freecad
  • OpenSCAD

For it to work three things must be fulfilled

  1. The device must be recognized by the kernel as input device
  2. The spacenavd daemon must be running
  3. The application must be compiled with spacenav support. (community/blender should be)

The first requirement should be fulfilled automatically after plugging in the device. It can be checked by looking if the device is listed in /proc/bus/input/devices e.g. by

For the second point install and (or if you need support for older serial mice) from AUR. For testing it is a good idea to start the daemon on foreground mode. The output should look similar to this: If it works you can simply shut down the daemon by hitting CTRL-C and run it using the following service to start the daemon (should come with spacenavd).

Now everything is up and running and every supported application should be able to use the 3D Mouse.

Blender with spacenav support

The blender package in the community repository is now compiled with spacenav support by default.

However, if you wish to rebuild Blender with spacenav support manually, you can install first and then rebuild blender from ABS. It will automatically build with support.

Now you can fire up blender and test your 3D Mouse.

$ blender
ndof: using SpaceNavigator

See also

This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.