rastapasta / react-native-gl-model-view

📺 Display and animate textured Wavefront .OBJ 3D models with 60fps - native bridge to GLView (iOS) and jPCT-AE (Android)
MIT License
419 stars 66 forks source link

Display obj file from project #31

Closed alz10 closed 4 years ago

alz10 commented 4 years ago

I got an error saying

Error while updating property 'texture' of a view managed by: RNGLModelView java.lang.Double cannot be cast to com.facebook.react/bridge.ReadableMap

import ModelView from 'react-native-gl-model-view';

   <ModelView
        model={require('../android/app/src/main/assets/Hamburger.obj')}
        texture={require('../android/app/src/main/assets/Hamburger.png')}
        scale={0.01}
        translateZ={-2}
        rotateZ={270}
        style={{ width: '100%', height: 500 }}
     />
rastapasta commented 4 years ago

Please follow the README to add the files correctly.

alz10 commented 4 years ago

Please follow the README to add the files correctly.

I read the whole instruction and followed it but the error still persist

     <ModelView
        model={require('../android/app/src/main/assets/Hamburger.obj')}
        texture={require('../android/app/src/main/assets/Hamburger.png')}
        ....
     />

or

    <ModelView
       model={'Hamburger.obj'}
       texture={'Hamburger.png'}
     />
alz10 commented 4 years ago

I still got this error

Error while updating property 'model' of a view managed by: RNGLModelView java.lang.Double cannot be cast to com.facebook.react/bridge.ReadableMap
Error while updating property 'texture' of a view managed by: RNGLModelView java.lang.Double cannot be cast to com.facebook.react/bridge.ReadableMap
rastapasta commented 4 years ago

Copy & paste from the README:

<ModelView
    model={{
      uri: 'model.obj',
    }}
    texture={{
      uri: 'texture.png',
    }}
/>