FBX SDK Fix Indices / Draw Order C++ -


I'm learning some DirectX 11 tutorials. I am using Autodesk FBX SDK to import models in my direct X view. But I have run into problems with indices, in which order you attract the corner. My FBX class imports values ​​similar to the Autodasc FBX converter. It then uses FbxAxisSystem so that the view can be compatible with DirectX, then it changes the Z axis, and swaps the Y and Z axis so that the rotation can match the model in my 3D modeling program. So far so good, right? Except that the triangle is completely out of the way Results in a strange looking mesh.

I've restricted it to two things: either its drawing order or its render I stad :: vector, which is to store both top buffer and index buffers. To make the problem easier - my top layout

  {"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0},  

AFAIK The render is working properly, but I am not completely sure because I have a bit width and a bit of a bit confusing. I have some code here:

  // ... Import to the index After in the initial function BitVid = Size (DWORD) * sizeof (Obj-> MeshIndicesBuffer); IinitData.pSysMem = & amp; (Obj-> MeshIndicesBuffer [0]); // ... vertexBufferDesc.ByteWidth = sizeof (float) * sizeof (Obj-> MeshVertexBuffer); Summit Buffer Data.pSysMem = & amp; (Obj-> Meshvirtex buffer [0]); // DrawIndexed (Obj-> MeshIndicesBuffer.size (), 0, 0) in the Draw function;  

To be clear, I am using std :: vector to store buffers.

How to fix the index so that it comes in the correct order? Is there a formula / algorithm? Does the FBX SDK have a function for it?

I have posted on my G + plane which I am trying to render.

I understand basic principles, rendering polygon (I can provide a cube using arrays), but I do not know how the index arises and this is my Why is not the "right" order from FBX file?


Comments