0

I'm really confused with obj and mtl files and relation between them. I searched and read about these formats but couldn't understand much. I need somebody to briefly explain these format's logic since I have a code to render an object by getting obj and mtl files that doesn't word correctly. (android opengles 1.1)

Assuming we have these lines in obj

usemtl Material1_
v ...
vt ...
.
.
.
f 1/1/1 2/2/1 3/3/1
f 2/2/1 1/1/1 4/4/1
usemtl _Charcoal_
v ..
vt ..  
f 5/5/2 4/6/3 1/7/2       #"problem HERE!"

and these lines in mtl file

newmtl Material1_
Ka 0.000000 0.000000 0.000000
Kd 0.533333 0.345098 0.282353
Ks 0.330000 0.330000 0.330000
map_Kd Material1_.jpg

newmtl _Charcoal_
Ka 0.000000 0.000000 0.000000
Kd 0.137255 0.137255 0.137255
Ks 0.330000 0.330000 0.330000 

the upper material uses a texture, the lower dont. but both uses texture datas in "f" lines! what texture should I use for the line I've marked? In general what I have to do with faces below a material that doesn't reference a texture? also there are multiple usage of a same material. what's the reason behind that?

Edric
  • 24,639
  • 13
  • 81
  • 91
Alireza Farahani
  • 2,238
  • 3
  • 30
  • 54
  • That does look odd, though in some modelling programs it's possible to assign uv coordinates without specifying a specific texture. I don't think there's any specific thing that you should do here per the specification, but I would just ignore them and move on. – Tim Dec 09 '12 at 00:54
  • @Tim that's the thing I'm doing now. but I get weird result. some textures are correct some are mixed (it seems only a small part of texture has used). Should I add my code to this post? – Alireza Farahani Dec 09 '12 at 06:26

0 Answers0