# Inter Quake Model IQM render Directx9

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?

The last parameter of your DIP call is wrong - it should be the size of your vertex struct, which - for position only - is going to be 3 floats.

• Thanks, that worked. Can't believe I missed that... I'd vote your answer up but won't let me without 15 rep... Nov 5 '12 at 9:21