Inter Quake Model IQM render Directx9
- by Andrew_0
I'm trying to render an Inter Quake Model(http://lee.fov120.com/iqm/) in DirectX9 that I exported from blender.
I want to display animations which IQM supports and my model format does not.
The model is a cylinder.
It loads fine in the iqm sdk opengl viewer but when i try to render it in directx9 using for example(this is just to render the vertices):
IDirect3DDevice9 * device;
HRESULT hr = S_OK;
for(int i = 0; i < nummeshes; i++)
{
iqmmesh &m = meshes[0];
hr = device->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0,
3*m.num_triangles, m.num_triangles ,&tris[m.first_triangle] ,D3DFMT_INDEX32
,inposition ,sizeof(unsigned int));
}
It renders like this:
Incorrect
The light grey bit that looks like two triangles in the middle is what is rendered(ignore the other stuff).
Whereas it is meant to look like this(using a custom importer which I designed which matches what is displayed in blender):
Correct
Anyone have any suggestions on what might be going wrong?