CesiumGS / obj2gltf

Convert OBJ assets to glTF
Apache License 2.0
1.68k stars 303 forks source link

How to specify the mtl file in my obj files? #226

Closed liuzhen2008 closed 4 years ago

liuzhen2008 commented 4 years ago

I have a .obj file an mtl file and an image.

However, when I try to convert into a gltf, it seems the mtl file is simply not recognized. Could you guys help me to figure out if there is something missing in the .obj file that causes the tool to not recognize the mtl? The zip file contains a obj, a mtl and a image file for texture Handle1.zip

lilleyse commented 4 years ago

Hi @liuzhen2008

I added mtllib Handle1.mtl to Handle1.obj and added file extensions to the images in Handl1.mtl. That fixed it for me.

Handle1.zip

liuzhen2008 commented 4 years ago

Yes sir, that has indeed fixed it for me. You are god send sir. How can I repay you.