Open oveddan opened 7 years ago
We briefly discussed this in class. The obj contains two meshes: one for editing (and computing normals) and one for texture mapping. The two arrays of faces are in 1-1 correspondence (the first face of the editing mesh corresponds to the first face of the uv mesh), while the vertices can be different. This is needed since you need to have UV seams for the texture that are potentially different than the seams that are used to design the mesh. When you compute normals, you should not follow the UV seams, or it will create strange discontinuities.
If you want to render it, you should use only the UV mesh, and replicate the normal informations on the "mesh vertices" into the "uv vertices".
I'm trying to use some obj files downloaded from the web for assets.
In the faces section of the file, some of the faces look like:
Where each vertex represented on the face is in the format: v1/vt1/vn1 (Vertex index/Vertex Texture Coordinate Index/Vertex Normal Index)
Why would the texture coordinate and normal index be different from the vertex index?
How are we supposed to line up texture coordinates to verteces when we want to send them as VBOs?
Is there anyways of using this with the element array buffer?