0
105 Apr 17, 2012 at 19:12 directx

Hi,

actually I try to render two connected triangle strips using DirectX 9 and degenerated
triangles but I fail, only the first strip is rendered:

Vertex vertices[] = {
Vertex(-1.0f,  0.0f,  0.0f, 255,    0,   0, 255),
Vertex(-1.0f,  1.0f,  0.0f,   0,  255,   0, 255),
Vertex( 0.0f,  0.0f,  0.0f,   0,    0, 255, 255),

Vertex( 0.0f,  1.0f,  0.0f,   0,  255, 255, 255),
Vertex( 1.0f,  0.0f,  0.0f,   0,  255,   0, 255),
Vertex( 1.0f,  1.0f,  0.0f, 255,  255,   0, 255),

Vertex( 1.0f,  1.0f,  0.0f, 255,  255,   0, 255),     //degenerated tris
Vertex(-1.0f, -1.0f,  0.0f,   0,  255,  255, 255), //degenerated tris

Vertex(-1.0f, -1.0f,  0.0f,   0,  255,  255, 255),
Vertex(-1.0f,  0.0f,  0.0f, 255,    0,   0,  255),
Vertex( 0.0f, -1.0f,  0.0f,  255,  255, 255, 255)
};

d3ddev->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 6);


If i understand this correctly, I’ve only add a degenerated
triangle to connect both strips:

http://msdn.microsof…v=vs.85%29.aspx

With OpenGL everything is working as expected, but with
DirectX is I could only render the first strip …

Thanks for any help.
Snoob

#### 2 Replies

0
167 Apr 17, 2012 at 20:28

DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 6);
That will only draw the first six triangles, no? Which includes the first strip and the two you marked as degenerate, but none of the second strip. The total number of triangles in the vertex buffer is 9.

0
105 Apr 17, 2012 at 20:34

Ahh thanks, Reedbetea. I was blink while I was totally fixed to my vertices
declaration …