Android Obj Loader

link1
link2

Face only vertex format is..
Vertex
A valid vertex index starts from 1 and matches the corresponding vertex elements of a previously defined vertex list. Each face can contain three or more vertices.
f v1 v2 v3 ….

Face with texture and normal is..
Vertex/texture-coordinate/normal
Optionally, normal indices can be used to specify normal vectors for vertices when defining a face. To add a normal index to a vertex index when defining a face, one must put a second slash after the texture coordinate index and then put the normal index. A valid normal index starts from 1 and matches the corresponding element in the previously defined list of normals. Each face can contain three or more elements.
f v1/vt1/vn1 v2/vt2/vn2 v3/vt3/vn3 ….

And Face with normal is
Vertex/normal
As texture coordinates are optional, one can define geometry without them, but one must put two slashes after the vertex index before putting the normal index.
f v1//vn1 v2//vn2 v3//vn3 …

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz