   [DX10] Obj files and index/vertex buffers
  Hi!I have written a small obj file loader for DX10, which loads the data and creates an ID3DX10Mesh used for drawing. The loader works quite well, and I am able to load meshes with multiple groups and textures just fine. I do have a question about indexing vertex positions though. Right now I have duplicate positions in my vertex data. This is, of course, something that index buffers are supposed to solve. However, I am unsure about how I should do this.I am using the following input layout for my vertex data.const D3D10_INPUT_ELEMENT_DESC layoutPositionNormalTexCoord[] ={{ "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D10_INPUT_PER_VERTEX_DATA, 0 },{ "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D10_INPUT_PER_VERTEX_DATA, 0 },{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 24, D3D10_INPUT_PER_VERTEX_DATA, 0 },} ;So for each element, I pass position, normal and texture coordinate data. Now, some of the vertices in my model may share the position with other vertices. These however, usually have different normal and texture coordinates. How am I supposed to index a previously passed vertex position (as opposed to add a new duplicate one, as I am doing now), since that previously passed position has normal and texture coordinate data along with it that does not make sense for the current vertex? I would like to index the texture and normal coordinates separately, but apparently DX uses one index buffer for all data...This is probably easy to solve, I just cannot figure out how to do it. Sorry if the post is unclear, I am a bit confused right now :)
  If the position is the same but the normal or texture coordinate is different, then you can't merge those vertices. I wouldn't worry about it at all though...it's a very common situation.   