# Directx9, FBX sdk and indices problem

So I've set up my program, know how to get everything going except for one thing: indices. I've been stumped as to how I retrieve that set of data. Does anyone know what I function I need to get them? Thanks in advance!

Assuming you're using the latest fbx sdk, read:

http://www.gamedev.net/page/resources/_/technical/graphics-programming-and-theory/how-to-work-with-fbx-sdk-r3582

Fundamentally, the FBX sdk stores vertex and index data in a way that is not conducive for rendering api requirements in order save on repeated data. We have to construct the vertices themselves. To do this, for each vertex, retrieve the indices (mentioned in the above link), and construct your own 'vertex reference' structure, then store them in an array, and add an index to your index buffer. But before you do that, check to see if past vertices have any duplicated vertices (by comparing indices of the 'vertex reference' structure), in which case, use that index instead.

If the data has no indices, you can simply feed linear list if your rendering API requires them.

I.e,

int *indices = new int[max_vertex_count];
int i;
for (i = 0; i < max_vertex_count; i++)
indices[i] = i;