Rendering .obj Model in DirectX 11

Started by
29 comments, last by eee 9 years, 3 months ago

The box is now getting rendered as expected (with correct vertices and UV), but only after I filled the index buffer like this:


indices = new DWORD[36];
for (int i = 0; i < 36; i++)
     indices[i] = i;

Anyone know why?

This is because your .obj file is not exported to use indices, that is, it defines every single vertex (there are duplicates) that are needed to draw the object in a specific order. When you try to use an index buffer you are basically forcing the object to be drawn using indices, but the original file did not support that.

This topic is closed to new replies.

Advertisement