   Question on index buffer and texture coordinate
  I have read the source code of Directx9 SDK's tutorial MeshFromOBJ.I am confused by these lines:// If a duplicate vertex doesn't exist, add this vertex to the Vertices // list. Store the index in the Indices array. The Vertices and Indices // lists will eventually become the Vertex Buffer and Index Buffer for // the mesh. DWORD index = AddVertex( iPosition, &vertex ); m_Indices.Add( index );  }The declare of AddVertex:DWORD CMeshLoader::AddVertex( UINT hash, VERTEX* pVertex );and the two lines of my .obj file.f 1/1/1 2/2/2 3/3/3 f 1/4/1 3/3/3 4/5/4 The first and the fourth texture coordinate(vt) share the first vertex(v).But in the lines is:(one index)->(one vertex,including texture coordinate and normal).And the index is position of the vertex.What's wrong?How to create and use index buffer if different coordinates share the same the vertex.Thanks.[Edited by - mghohoo on May 13, 2010 7:26:23 AM]
  Directx/OpenGL do not understand shared vertices.If you have a vertex in your obj file with 2 different texture coordinates, you need to duplicate the vertex for it to work.That's what the lines you're confused about do, they add an additional vertex to avoid the sharing problem.This does not conflict with index buffering, but you'll have a few more vertex points then you did in your obj file.This is unavoidable though.   ;Quote:Original post by HyunkelDirectx/OpenGL do not understand shared vertices.If you have a vertex in your obj file with 2 different texture coordinates, you need to duplicate the vertex for it to work.That's what the lines you're confused about do, they add an additional vertex to avoid the sharing problem.This does not conflict with index buffering, but you'll have a few more vertex points then you did in your obj file.This is unavoidable though.Thanks for your help.I have read it again.The parameter hash is fantastic.The index is assigned to the vertex(with different texture coordinates and normals) list.Is that true?