Search code examples
.objwavefront

Handling .obj files: Why is it possible to have more vertextextures (vt) than vertices (v)?


I am working on a .obj handler in c++. Importing the data shouldn't be a Problem, but i do not understand why it is possible, that a .obj (e.g. exported from blender) has more 'vt' entries than 'v' entires. If someone could explain me that, i would be very happy!

Thanks!


Solution

  • The number of position, normal and texture coordinates may be different because two vertices may share a coordinate in one space but differ in another.

    Think of a box (8 verts) using 6 different rectangular shapes (one per face) in texture space -> that's 6*4=24 texture coordinates.

    Edit: A common uv-map for a box looks like below (14 texture coordinates). I've annotated three different vertices: A, B and C. Note that in a box every vertex is adjacent to three faces which has to be true in the uv-map also. C gets a texture coordinate which is adjacent to three faces, but B has to be duplicated and A tripled to do so.

    Box-uv