A sandbox for reference implementations of OMI gltf-extensions for three.js
npm install -S three three-omi
import { AudioListener } from "three";
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
import { GLTFAudioEmitterExtension } from "three-omi";
// The extension needs a reference to your player's AudioEmitter
const audioListener = new AudioListener();
const gltfLoader = new GLTFLoader();
gltfLoader.register(parser => new GLTFAudioEmitterExtension(parser, audioListener));
const { scene } = await gltfLoader.loadAsync("OutdoorFestival.gltf");
A live version of the examples is running here.
Run the examples locally by running:
cd three-omi
npm install
npm run dev