Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer
    
Thanks, that worked. Can't believe I missed that... I'd vote your answer up but won't let me without 15 rep... –  Andrew_0 Nov 5 '12 at 9:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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