Skip to content

Repository files navigation

Chrome SpaceMouse Controller Logo

Chrome SpaceMouse Controller

Chrome extension providing 6-DOF 3Dconnexion SpaceMouse and XInput gamepad support for web-based 3D viewers.

Supported Viewers

  • Sketchfab (sketchfab.com and embedded iframes)
  • Three.js viewers using OrbitControls or standard mouse drag and wheel navigation

Installation

  1. Open chrome://extensions in Chrome.
  2. Enable Developer mode in the upper-right corner.
  3. Click Load unpacked and select this directory.
  4. Pin the extension to the toolbar for quick access to the popup menu.

Quick Start

  1. Connect the 3Dconnexion SpaceMouse via USB.
  2. Open the extension popup in Chrome and click Connect.
  3. Select the 3Dconnexion HID device. Verify that axis inputs respond in the live status display.
  4. Open a 3D model page on Sketchfab or Three.js to start navigating.

Control Mappings

SpaceMouse (6 Axes)

Axis Action
Translation X (push left/right) Pan left / right
Translation Y (push up/down) Pan up / down
Translation Z (push/pull) Zoom in / out
Rotation X (pitch) Pitch up / down
Rotation Y (yaw) Yaw left / right
Rotation Z (roll) Roll (disabled by default, supported in direct camera mode)

Gamepad (Xbox / XInput)

Input Action
Left Stick X Pan left / right
Left Stick Y Move forward / backward
Right Stick X Look left / right
Right Stick Y Look up / down

Dual controller mode is supported. Select primary and secondary gamepad indices in the options page.

Navigation Modes

  • Sketchfab Orbit Mode (Default): Simulates mouse drag and scroll wheel interactions matching default Sketchfab controls.
  • Sketchfab First Person Mode: Emits WASD and arrow key events. Requires setting the Sketchfab viewer to First-Person mode.
  • Three.js Pointer Simulation: Simulates pointer events for standard OrbitControls implementations.
  • Three.js Direct Camera (Experimental): Directly updates the active Three.js camera position and orientation with full 6-DOF movement. Requires window access to THREE.

Configuration Options

Access the Options page from the extension popup or context menu to configure:

  • SpaceMouse: HID report parsing (Auto, 8-bit, 16-bit split, 16-bit combined), raw max bounds, deadzone, per-axis sensitivity, and axis inversion.
  • Gamepad: Deadzone thresholds, stick mappings, and index assignments.
  • Viewers: Orbit, pan, and zoom sensitivity scaling.
  • WebSocket Bridge: Fallback connection settings when direct WebHID access is unavailable.

Python Bridge Fallback

If native 3DxWare drivers lock the USB device and prevent WebHID access, run the included Python WebSocket bridge:

pip install pyspacemouse websockets
python bridge/spacemouse_bridge.py

Enable Enable Bridge in the extension popup. The bridge runs locally at ws://127.0.0.1:8080.

Architecture Notes

  • Local execution: No external network connections are made.
  • Multi-language support: UI strings are localized in _locales/ (English and French).
  • Bridge communication remains restricted to 127.0.0.1.

About

Chrome extension providing 6-DOF 3Dconnexion SpaceMouse and XInput gamepad support for web-based 3D viewers.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages