3D Mouse

From ArchWiki
Jump to: navigation, search

What is a 3D Mouse?

"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." - Wikipedia

For more information: http://www.3dconnexion.com/products/what-is-a-3d-mouse.html

3DConnexions 3D Mouse

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


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 or if you need lesstif (e.g. for xpdf) you can just get the libXm.so.4 library from it:

$> sudo pacman -Sw openmotif # download openmotif to cache, do not install
$> tar xJOf /var/cache/pacman/pkg/openmotif-* usr/lib/libXm.so.4.0.3 > libXm.so.4
$> sudo mv libXm.so.4 /usr/lib/libXm.so.4

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

$> sudo 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.

/* 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 <utmpx.h>

int main(int argc, char ** argv) {
  if (argc != 2) {
    fprintf(stderr, "Need a name to put in the structure\n");
  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]);
$> gcc 3dmouse.c -o 3dmouse
$> sudo ./3dmouse root

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

6. Unpack the install script and run it

$> tar xfz 3dxware-linux-v1-5-2.i386.tar.gz install-3dxunix.sh
$> sudo ./install-3dxunix.sh

This installs 3DxWareUnix V1.5.2 on this machine. Continue? (y/n) [y]

 Choose one of the following platforms:

  1.  HP-UX
  2.  Solaris
  3.  AIX 5
  4.  Linux
  5.  Exit

Please enter your choice (1-5)[4]:

Installing files for 3DxWare for Unix / linux......

Uninstalling a running driver. Please wait ...

Converting default configs V5.x to V5.3.
(User configs will be converted when used)
Please wait a moment...
Converting configs... found 27 configurations
Configuration file             Configuration name       Version Status
/etc/3DxWare/UGSNX2_01.scg     ("UGS NX 2 config 01      ") 5.3 Ok.
/etc/3DxWare/4DNav.scg         ("4D Navigator            ") 5.3 Ok.
/etc/3DxWare/UGSNX5_02.scg     ("UGS NX 5 config 02      ") 5.3 Ok.
/etc/3DxWare/CatiaV5_02.scg    ("CATIA V5 config 02      ") 5.3 Ok.
/etc/3DxWare/Maya2011.scg      ("Maya 2011               ") 5.3 Ok.
/etc/3DxWare/CatiaV4_01.scg    ("CATIA V4                ") 5.3 Ok.
/etc/3DxWare/Patran_01.scg     ("Patran                  ") 5.3 Ok.
/etc/3DxWare/UGSNX4_01.scg     ("UGS NX 4 config 01      ") 5.3 Ok.
/etc/3DxWare/Pr(...)ire_02.scg ("ProE Wildfire config 02 ") 5.3 Ok.
/etc/3DxWare/Pr(...)ire_01.scg ("ProE Wildfire config 01 ") 5.3 Ok.
/etc/3DxWare/UGSNX2_02.scg     ("UGS NX 2 config 02      ") 5.3 Ok.
/etc/3DxWare/CatiaV5_03.scg    ("CATIA V5 config 03      ") 5.3 Ok.
/etc/3DxWare/UGSNX3_02.scg     ("UGS NX 3 config 02      ") 5.3 Ok.
/etc/3DxWare/default_10.scg    ("Driver Protocol 1.0     ") 5.3 Ok.
/etc/3DxWare/CADDS_R14.scg     ("CADDS5 R14 +            ") 5.3 Ok.
/etc/3DxWare/CatiaV5_01.scg    ("CATIA V5 config 01      ") 5.3 Ok.
/etc/3DxWare/DMUNav.scg        ("DMU Navigator           ") 5.3 Ok.
/etc/3DxWare/UGSNX4_02.scg     ("UGS NX 4 config 02      ") 5.3 Ok.
/etc/3DxWare/Enovia_VPM.scg    ("Enovia VPM              ") 5.3 Ok.
/etc/3DxWare/UGSNX5_01.scg     ("UGS NX 5 config 01      ") 5.3 Ok.
/etc/3DxWare/ICEM_MED.scg      ("ICEM MED                ") 5.3 Ok.
/etc/3DxWare/CADDS_R13.scg     ("CADDS5 -R13             ") 5.3 Ok.
/etc/3DxWare/DVise.scg         ("DVise                   ") 5.3 Ok.
/etc/3DxWare/Op(...)alizer.scg ("Optegra Visualizer      ") 5.3 Ok.
/etc/3DxWare/UGSNX3_01.scg     ("UGS NX 3 config 01      ") 5.3 Ok.
/etc/3DxWare/IDEAS_01.scg      ("IDEAS                   ") 5.3 Ok.
/etc/3DxWare/default.scg       ("Any Application         ") 5.3 Ok.


Do you want 3DxWareUnix being started with every login (from the /etc/inittab)? (y/n) [y]

Please start the driver manually. [/etc/3DxWare/daemon/3dxsrv -d <port>]

    For testing purposes you can find the demos
                      xcube and xvalues at /tmp

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):

$> sudo /etc/3DxWare/daemon/3dxsrv -d USB

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

$> tar xfz 3dxware-linux-v1-5-2.i386.tar.gz xcube
$> ./xcube

More Information