
React Three Fiber
3D & game enginesLoad your Vuframe 3D models into React Three Fiber apps with the GLB export and useLoader with GLTFLoader.
Vuframe® exports your 3D models as GLB, the binary form of glTF. React Three Fiber, the React renderer for three.js, loads GLB files with three.js's GLTFLoader, so you can build your products into React apps as components.
Add Vuframe content to React Three Fiber
- Ask your Vuframe project manager for the GLB export of your 3D model.
- Put the GLB in your app's public folder or on your CDN.
- Load it in a component and render the scene:
jsx
import { useLoader } from '@react-three/fiber'
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js'
function Product() {
const gltf = useLoader(GLTFLoader, '/model.glb')
return <primitive object={gltf.scene} />
}- Place
<Product />inside your<Canvas>, wrapped in<Suspense>.
Good to know: the useGLTF hook from @react-three/drei is a shorter alternative, and gltfjsx turns the GLB into an editable JSX component. 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 R3F docs on loading models.