Replies: 2 comments 4 replies
-
useloader is for async fetch requests. const [gltf, set] = useState()
useEffect(() => new GLTFLoader().parse(url, "/", set), [url]) this is what useloader does internally anyway. try not to think of these hooks as something that changes threejs rules. when in doubt, use threejs as you always would. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the clarification, I did get this far with parse(), now what would be the best course of action adding the gltf scene to my canvas? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have an arraybuffer of a .glb file in memory and would like to load its contents into my scene. Unfortunately it's not an option to write the file to disk and get a path. But the buffer can be parsed using the
.parse()
method of THREE's GLTFloader to something like:How do I go about using this in a R3F Canvas component?
Alternatively, can
useLoader()
hook take an arraybuffer instead of a path?Beta Was this translation helpful? Give feedback.
All reactions