Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with React Native CLI (OBJ & GLTF) #3299

Open
mattlewer opened this issue Jun 30, 2024 · 1 comment
Open

Not working with React Native CLI (OBJ & GLTF) #3299

mattlewer opened this issue Jun 30, 2024 · 1 comment

Comments

@mattlewer
Copy link

mattlewer commented Jun 30, 2024

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):
#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:
#3085
#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...

@mattlewer
Copy link
Author

mattlewer commented Jun 30, 2024

React Native CLI project created showing failures mentioned:
https://github.com/mattlewer/ReactFiberDemo

Expo CLI project with similar issues:
https://github.com/mattlewer/ReactFiberDemo-Expo

After the original post, I have also now tried the same thing with an Expo Cli project which also gives the same results.

A & B do not error, but I get a warning about decodeText being deprecated, obj returned is logged as the following, but nothing is visible on the screen:
{"metadata": {"generator": "Object3D.toJSON", "type": "Object", "version": 4.6}, "object": {"layers": 1, "matrix": [Array], "type": "Group", "up": [Array], "uuid": "ccd3c3b9-db80-4e9b-9678-b1840f7a6a23"}}

C fails with Failed to load buffer "buffer.bin" .

Hopefully having similar issues on both helps to resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant