CesiumGS / obj2gltf

Convert OBJ assets to glTF
Apache License 2.0
1.71k stars 307 forks source link

can't load the gltf converted from obj #6

Closed guazipi closed 8 years ago

guazipi commented 8 years ago

I've convert my obj file to gltf, when I added gltf on the cesium, an error happened, just as follows: 2015-12-19 15 42 24 I don't know why. Please help me

pjcozzi commented 8 years ago

Can you share the original OBJ model so we can debug this?

guazipi commented 8 years ago

pjcozzi, Thank you very much! 归档.zip

lilleyse commented 8 years ago

Thanks for sending over the model. The problem was caused by the formatting of the obj file, in particular your file defines faces like f 596/596/ 688/688/ 2116/2116/ whereas the code expected f 596/596 688/688 2116/2116. I made a quick change to support that formatting, and tested that it loads without errors in Cesium.

guazipi commented 8 years ago

Thank you very much, I'm glad to hear that. You mean I have to change the file like f 596/596/ 688/688/ 2116/2116/ to f 596/596 688/688 2116/2116 one by one? Oh, that's a terrible news. I'll try it right now, thank you again!

lilleyse commented 8 years ago

I made a change to the code to support the formatting, just download it again and test it out. You don't need to do it by hand.

guazipi commented 8 years ago

awesome,I've tested it and it ran in Cesium without errors, but I have another problem which is that texture isn't on his position. Is your texture on the right position when you tested it?

2015-12-24 11 37 05

It should be like this:

2015-12-24 11 39 29

Look forward to your reply!

lilleyse commented 8 years ago

I'm not completely sure why this is happening, but one temporary fix is to flip the image vertically. It looks correct to me now: capture

guazipi commented 8 years ago

Can you share the code to me? Thank you very much

lilleyse commented 8 years ago

I just flipped the image in Paint. Once again, its a temporary fix and I hope to find the real problem.

guazipi commented 8 years ago

Actually, I don't understand what you said about flipped the image, how did you operate the texture of gltf model?

guazipi commented 8 years ago

Hi, Sean, I am here again. Sorry to disturb you again, but I still get it about 'flip the image', I just don't understand how you can operate the texture of model. I add the model as an entity on the Cesium, Please help me to figure it out and show me how to do it, thank you very much, look forward to your reply!

lilleyse commented 8 years ago

Sorry for the delay. What I mean about flipping the image is doing it in some outside program, you shouldn't have to make any changes in Cesium or the glTF model. If you use this image here it should work for you as well. tile_ 000_ 000_ 000_l18_0001_0