I'm just beginning with irrlicht and I may be wrong in reporting this as a bug ( maybe it's my fault ).
I have a convex polygon that doesn't appear at all ( or get filled) when using drawVertexPrimitives with EPT_polygon ( renderer opengl ). With EPT_LINE_LOOP i can clearly see the summits.
And when I told myself to try with triangle fans, my program crashes.
Here is some code betwenn begin and endscene.
Code: Select all
video::S3DVertex vertices[6];
//vertices[0].TCoords = core::vector2df(1.0f, 1.0f);
vertices[0].Pos = core::vector3df(0.f,0.f,-40);
vertices[1].Pos = core::vector3df(0,20,0.1);
vertices[2].Pos = core::vector3df(3,25,0.1);
vertices[3].Pos = core::vector3df(100,25,0.1);
vertices[4].Pos = core::vector3df(100,5,0.1);
vertices[5].Pos = core::vector3df(97,0,0.1);
short int index[7];
for(unsigned int i=0; i<6; i++)
{
index[i]=i;
vertices[i].Color = video::SColor(255, 255, 255, 255);
}
index[6] = 0;
driver->draw2DVertexPrimitiveList ( vertices,
6,//6 vertices
index,//const void * indexList,
7,//u32 primCount, unsure about this parameter
EVT_STANDARD,
scene::EPT_POLYGON // bug with EPT_TRIANGLE_FAN
);