A modular Three.js library for creating immersive underwater/dive model viewers with VR support
npm install belowjs


š Full Documentation & Examples
> Current Version: 1.5.0 - Fly mode controls, experimental stereoscopic viewing, and improved material rendering.
Dive Shipwrecks in Virtual Reality
Setup virtual dives in minutes. Full control over your underwater photogrammetry models. Web and virtual reality as first class technologies.
BelowJS is a 3D model viewer built on Three.js that allows communities to share their underwater photogrammetry models on the web and in VR.
Virtual reality and desktop modes are tightly integrated with a measurement system, so archaeologists can research sites with confidence. An optional dive mode lets audiences feel the wrecks as they are - optimised for the Meta Quest 3 headset.
BelowJS can be deployed statically or as part of a system. A simple GitHub page can share optimised models for free, and will last forever with little maintenance. Conversely, it can power dynamic systems like BelowVR, which lets teams virtually dive together.
Sensible defaults make your work look beautiful. We have tools to help you optimise, scale and annotate them.
The code is yours, as long as you share what you do with it.
``bash`
npm install belowjs three
`javascript
import { ModelViewer } from 'belowjs';
import 'belowjs/dist/belowjs.css';
const config = {
models: {
'kxi': {
url: 'shipwreck.glb'
}
}
};
const viewer = new ModelViewer('body', config);
`
This gives you a complete VR-ready 3D viewer with dive lighting, measurement tools, and mode switching enabled by default.
`html`
- Loads and displays GLB 3D models in a web browser
- Works with VR headsets through WebXR, optimised for Quest 3
- Provides measurement tools for both desktop and VR environments
- Includes underwater lighting simulation and particle effects
- Supports multiple models with dropdown switching
- Can be embedded in iframes with URL parameter configuration
Three different examples are included:
`bash`
git clone https://github.com/patrick-morrison/belowjs
cd belowjs
npm install && npm run build
- npm run dev ā Full-featured viewer with model selection and all systems enablednpm run dev:dragdrop
- ā File loader with drag-and-drop GLB support and custom UI elementsnpm run dev:embed
- ā Lightweight viewer designed for iframe embedding
- Basic Viewer ā Full-featured multi-model viewer
- Drag & Drop ā File loader with custom UI; recommended path for Meta Quest Link desktop streaming
- Embed Viewer ā Lightweight iframe-ready viewer
bash
npm install belowjs three
`$3
If you prefer to install manually, clone the repository and build the distribution files:
`bash
git clone https://github.com/patrick-morrison/belowjs
cd belowjs
npm install
npm run build
`This builds the necessary files into the
/dist directory:
- belowjs.js (~419 KB) ā ES modules version
- belowjs.css (~20 KB) ā Complete stylesheetDeployment
Deploy statically on your server, integrate with JS/ES modules in an app, or simplest of all - GitHub Pages:
`
shipwrecks-vr/
āāā index.html # Main HTML with BelowJS
āāā belowjs.js # Download from releases
āāā belowjs.css # Download from releases
āāā models/
āāā kxi.glb
āāā kozvii.glb
`Push to GitHub, enable Pages in Settings ā live in minutes.
Usage
$3
`javascript
import { ModelViewer } from 'belowjs';
import 'belowjs/dist/belowjs.css';new ModelViewer('#container', {
models: { 'ship': { url: 'model.glb', name: 'Historic Ship' } }
});
`$3
`javascript
new ModelViewer(document.body, {
models: {
'wreck': {
url: 'shipwreck.glb',
name: 'Historic Shipwreck',
initialPositions: {
desktop: {
camera: { x: 10, y: 5, z: 15 },
target: { x: 0, y: 0, z: 0 }
},
vr: {
dolly: { x: 0, y: 2, z: 10 },
rotation: { x: 0, y: 0, z: 0 }
}
}
}
},
enableVR: true,
enableMeasurement: true,
enableDiveSystem: true,
enableScreenshot: true
});
`Enable
enableScreenshot to add a button that captures the scene without UI overlays.$3
The embed example supports URL parameters for dynamic configuration:`html
src="viewer.html?model=wreck.glb&name=Historic%20Wreck&cx=10&cy=5&cz=15"
width="800" height="600">
`Development
`bash
npm run build # Build distribution files
npm run dev # Start development server
`The examples load from
/dist/. Run npm run build once before first testing to generate /dist/. During npm run dev`, source edits will auto-rebuild the library.GPL-3.0-or-later ā See LICENSE file.
---
Created by Patrick Morrison.
Built for underwater archaeology. Models courtesy of WreckSploration.