Archived

This topic is now archived and is closed to further replies.

ofer

Direct3D9: (ERROR) :Invalid index in the index stream: 21

Recommended Posts

hi, i get this error when trying to draw a single strip. i dont know what cause this problem. can somebody here give me a hint? the error is - Direct3D9: (ERROR) :Invalid index in the index stream: 21 thnx.

Share this post


Link to post
Share on other sites
i have played around with it, and ill ask another question that is easier to answare. lets say i have a long index buffer, which holds many isolated strips, and i want to draw one of them.
the index buffer looks like that -
{0, 3 , 1, 4, 2, 5, 3, 6, 4, 7, 5, 8};
from 0 to 5 - first strip.
from 3 to 8 - second strip.

i draw the first strip like that -
DrawIndexedPrimitive( D3DPT_TRIANGLESTRIP, 0, 0, 6, 0 ,4);
and it works.
the second strip -
DrawIndexedPrimitive( D3DPT_TRIANGLESTRIP, 0, 3, 6, 3 ,4);
and it doesnt. it outputs this error -
Direct3D9: (ERROR) :Invalid index in the index stream:

so, how should i do it?

Share this post


Link to post
Share on other sites
You are telling it to start at index position 3, and telling it that the lowest vertex index in use is 3. Yet if you actually start at index position 3, and look ahead, you'll see vertex index 2 is in the range you requested. And since 2 is less than 3, it is an invalid vertex index value.

You might want to take a look at a tutorial I wrote about this topic, some time ago. It uses DirectX 8, but it is still relevant. http://bellsouthpwp.net/d/f/dfrey69/dip.htm

Edit: Would have made that an active link but I can't figure out how to post links on here, ain't using normal ubb codes.

[edited by - Mastaba on March 6, 2003 2:13:20 PM]

Share this post


Link to post
Share on other sites