arcplus / ObjConvert

convert wavefront obj files to other file format, like gltf, 3dtiles
MIT License
59 stars 19 forks source link

Obj parser is not successfully assigning materials #11

Open TrabacchinLuigi opened 5 years ago

TrabacchinLuigi commented 5 years ago

Obj parser is assigning the material in a wrong way, it is meant to be a state machine and start with the default material, and all subsequent geometries should have the last selected material

stoneflyop1 commented 5 years ago

Hi, When a usemtl appears, a face is created and the current material is attached to the face. I think the result is the same as you describe. Thanks.

TrabacchinLuigi commented 5 years ago

absolutely not. usemtl defines the material that will be used subsequently from that moment onward, the result was totally wrong. if no material is provided a default white material is used. Same here, i've already fixed this, have a look at my fork!