Open imyuanx opened 1 year ago
I use spline generate the code of react-three-fiber, but it and example code of the react-three-fiber docs are different.
Hi, can you elaborate on what part of the generate code doesn't work on react-native? They both seem valid r3f examples to me.
Could you test if the code generated from gltfjsx works in react-native? We took inspiration from that.
I changed a simple model to run successfully, useSpline
can't load local file, I must provide a url.
I got warn and error when I use complex model.
Continuously receive error ERROR TypeError: undefined is not an object (evaluating 'this.image.img.width')
Will this issue be solve soon, because it still is a problem till this day?
I checked the issues, It seems that many people have the same problem as me, but no solution.
I tried
react-spline
withreact-three-fiber
, there are two problems to be solved.Problem 1
react-spline
load spline file from url, but React Native not supportFileReader.readAsArrayBuffer
.Related issues
https://github.com/facebook/react-native/issues/21209
https://github.com/facebook/react-native/pull/30769
We can add the polyfill of
FileReader.readAsArrayBuffer
atSplineLoader
. I tried, it work. see: https://github.com/facebook/react-native/issues/21209#issuecomment-495294672Problem 2
I use spline generate the code of
react-three-fiber
, but it and example code of thereact-three-fiber
docs are different.spline generate code
Example code of the
react-three-fiber
docsI'm looking for a way to convert between them. After their conversion, spline can work perfectly in React Native.