I’m using drei usegltf to load a glTF asset:
export default function GLTFModel(props: GLTFModelProps) {
const gltf = useGLTF(props.model);
return <primitive object={gltf.scene} />;
}
<Canvas>
<Suspense fallback={null}>
<GLTFModel model={glbUrl}/>
</Suspense>
</Canvas>
While this works well for glTF assets available from a local or remote URL, I’m attempting to render a glTF asset I have available as a binary blob
- API returns GLB as
application/octet-stream
const response = await fetch(apiUrl, {});
const data = await response.blob();
- Want to render the binary data
const gltf = useGLTF(data);
Is there a way to work this out without API uploading the GLB to a URL?