react-three-fiber
react-three-fiber copied to clipboard
Not working with React Native CLI (OBJ & GLTF)
I've spent the last several hours trying to get this library to work with React Native CLI and haven't managed to get a single custom 3d object rendered, feel like I'm losing it.
Reference to my original bug post (closed to make this one instead, but please reference if needed): https://github.com/pmndrs/react-three-fiber/issues/3298
Initially wanted to render an OBJ file, ran into the same issues posted here where it is admitted that loading a OBJ file does not work properly, the solutions do not work for me either: https://github.com/pmndrs/react-three-fiber/issues/3085 https://github.com/pmndrs/react-three-fiber/issues/3199
Gave up on that and converted it to a GLTF to start from the simplest approach of following the docs.
First of all I have a TypeScript error that Property 'scene' does not exist on type 'GLTF | GLTF[]'.
when this is what the docs say to do here?:
https://docs.pmnd.rs/react-three-fiber/getting-started/installation#react-native:~:text=...props%7D-,object%3D%7Bgltf.scene%7D,-/%3E%0A%7D%0A%0Aexport
Then when I run it I get another error:
Error: Could not load 1: THREE.GLTFLoader: Failed to load buffer "model.bin".
I'm honestly at a loss, will provide example repo's so hopefully you can spot the issue here...