three.js
3D & game enginesLoad your Vuframe 3D models into three.js scenes with the GLB export and the GLTFLoader add-on.
Vuframe® exports your 3D models as GLB, the binary form of glTF. three.js loads GLB files with its GLTFLoader add-on, so you can place your products in your own WebGL scene.
Add Vuframe content to three.js
- Ask your Vuframe project manager for the GLB export of your 3D model.
- Host the GLB file on your web server or CDN, next to your app.
- Import the loader:
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js'; - Load the file and add it to your scene:
const gltf = await new GLTFLoader().loadAsync('model.glb'); scene.add(gltf.scene); - Add lights or an environment map so the PBR materials show correctly.
Good to know: serve the page over HTTP, not from the file system, or the browser blocks the request. If you need no code, embed the Vuframe 3D viewer as an iframe and control it with the JavaScript API. More: 3D formats, glTF / GLB and the three.js docs for GLTFLoader.