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

model and texture files not working #22

Closed Amjad675 closed 5 years ago

Amjad675 commented 5 years ago

Everything has been linked and works fine without any linking issues. But when I pass the model and texture props to ModelView as below model={{ uri: "cmodel.obj" }} texture={{ uri: "texture.png" }}

I get the following error (screenshot attached)

Can somebody please assist me on this? Screen Shot 2019-04-10 at 6 25 09 PM

rastapasta commented 5 years ago

Dear @Amjad675, you were faster than me :)

Just pushed the new version (with the new URI scheme) to NPM as v1.4.0 - could you check if you are on the correct version @package.json?

Cheers!

Amjad675 commented 5 years ago

Hi @rastapasta Thanks for the update.

There is no error like before. But I do get a warning for failed prop type for model and texture. As a result the 3D object is not rendered.. Any reason as to why?

Is there any specific way you pass the URI to the model and texture? The .model and .png files are in the root of the xcode project too. model={{ uri: "demon.model" }} texture={{ uri: "demon.png" }}

Screen Shot 2019-04-10 at 8 21 40 PM Screen Shot 2019-04-10 at 8 21 52 PM

Amjad675 commented 5 years ago

I removed the node_modules folder and ran npm install again and the issue was solved.. I did not change the structure of model and texture.. Kept them as below and worked flawlessly 😍

model={{ uri: "demon.obj" }} texture={{ uri: "demon.png" }}

Thank you so much @rastapasta for the support :) Appreciate your hard work! Keep it up 👍 Screenshot_2