views:

14

answers:

0

I need to read the duplicates chunk from an .x file.

.x file can be saved in text format, I wrote a tool that generates meshes and saves them in x files, I found that if I'm generating the x file with duplicates, and calculate the adjacency info, and passing it to the save function, it will save a chunk with the duplicates.

pMesh->GenerateAdjacency(0.01F, pAdjacency);
D3DXSaveMeshToX(filename, pMesh, pAdjacency, NULL, NULL, 0, D3DXF_FILEFORMAT_TEXT));

the .x file will contain the template

template VertexDuplicationIndices {
 <b8d65549-d7c9-4995-89cf-53a9a8b031e3>
 DWORD nIndices;
 DWORD nOriginalVertices;
 array DWORD indices[nIndices];
}

But when I load the X file, I cannot find a way to process it, sure I can go over all the vertices and find if they are duplicates, but it will slow down my loading time, and that info is already saved in the file, I wanna be able to use it.

Any ideas?