useGLBF and MongoDB #598
Unanswered
Eliott-Sarrey
asked this question in
Q&A
Replies: 2 comments
-
https://threejs.org/docs/#examples/en/loaders/GLTFLoader maybe? and run an .onload to wait for it to load completely before rendering? sorry, this answer might be too directly threejs oriented. I would consider using gltfjsx --transform, if can significantly reduce the size of any gltf model. |
Beta Was this translation helpful? Give feedback.
0 replies
-
if you want the same caching behaviour and suspense integration: import suspend from 'suspend-react'
import { GLTFLoader } from 'three-stdlib'
function Model() {
const { scene } = suspend(() => new Promise((res, rej) => new GLTFLoader().parse(buffer, "/", res, rej), [buffer]) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I would like to render a GLB file stored in my MongoDB database using DREI.
What I fetch is a string with the content of the GLB. In my previous tests, I was using the function useGLBF and a local file. However, this function does not accept any string. Does anyone know how I could parse my file (using loader.parse() I guess) in order to be able to use this function and DREI?
Thank you in advance!
Best regards,
Eliott
Beta Was this translation helpful? Give feedback.
All reactions