I'm wirting my first OpenGL Application for Android at the moment and now I get stuck on the ObjectLoader for obj files. I have some qestions to this file format and I can't an answer on the internet for this. Maybe it is easier if we go throught all these questions with an example file:
#Cube file - has no texture mtllib dice_material.mtl v 0.475013 0.999999 -0.066651 # 1 v 0.457026 0.999999 -0.067220 # 2 v 0.439582 0.999999 -0.067505 # 3 ... vn 0.000000 1.000000 0.000000 # 1 vn 0.000000 0.999969 0.000000 vn 0.000000 0.778466 0.627674 ... f 1//1 11//1 14//1 2//1 # the first 1 references to the first v right? f 2//1 14//1 15//1 3//1 # the first 2 references to the second v right? f 3//1 15//1 16//1 4//1
Can I assume that allways the verticies v are on the head of the document (after some comments) followed by the texture coordinates (tv) and the normales (vn)?
If an object has a texture does the obj file allways have the texture coordinates? If not how can I calculate them on my own?
If the object has a texture is it required that the object has a material too or can an object have a texture without a material?
If the file contains the texture coordinates do the polygons (f) must contain the texture coordinates? Or is
f 1//1a valid polygon too if the file contains the texture coordinates?