0
\$\begingroup\$

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!

\$\endgroup\$
0
\$\begingroup\$

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.

\$\endgroup\$
0
\$\begingroup\$

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;
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.