There are two ways how the Spacenav client (e.g. Blender, OpenSCAD or FreeCAD) and the Spacenav server (Spacenav daemon connected to the 6DoF 3D mouse or our simulator) can reach each other:
The client might be compiled with both options (like X11 with fallback to socket interface) or only with one (like X11 only).
The server can be configured to provide both interfaces (it needs the ~/.Xauthority
X11 magic cookie)
or only the socket interface (if the cookie is missing).
If we have socket-only server and X11-only client, we can of course recompile the client or reconfigure the server.
Or we can have some fun, hack it in the LD_PRELOAD
fashion and translate the socket interface to the X11 one.
So we make X11 client talking to the socket server.
We use the CMake build system, so the steps are basically:
mkdir build && cd build && cmake .. && make
Required libraries:
We just run our favourite CAD with our hackish library preloaded:
LD_PRELOAD="./libspnav-lib-hack.so" freecad
and it translates the X11 API calls to the socket ones.
Our software works with this mouse:
The mouse connects using a wireless USB adapter with ID: 256f:c652
and identifies itself as 3Dconnexion Universal Receiver
Mouse utilities are free software © 2019-2020 GlobalCode