Hi,
i want to create a mesh of triangles that extends on the z/x plane( all the vertex have the same y = 0), so i create a vertex buffer:
struct VERTEX
{
D3DXVECTOR3 pos;
DWORD col;
};
LPDIRECT3DVERTEXBUFFER9 *g_pVB = NULL;
d3dDevice->CreateVertexBuffer(....., &g_pVB,......);
I lock the buffer and fill it with my vertices:
VERTEX *Vx;
int i = 0;
g_pVB->Lock(0,0,(void)&Vx,0);
for(int z = 0; z <= 1000; z += 100)
{
for(int x = 0; x <= 1000; x += 100)
{
Vx.position.x = x;
Vx.position.z = z;
Vx.position.y = 0;
i++;
}
}
g_pVB->Unlock();
Now, how can i create an index buffer to set up the trangle order? and how can i render the the indexed triangles?
Thank you very much for reading this and for the help :)
Kev