Sign in to follow this  

Usage of D3D Index Buffers

Recommended Posts

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;


d3dDevice->CreateVertexBuffer(....., &g_pVB,......);
I lock the buffer and fill it with my vertices:
int i = 0;


for(int z = 0; z <= 1000; z += 100)
   for(int x = 0; x <= 1000; x += 100)
      Vx[i].position.x = x;
      Vx[i].position.z = z;
      Vx[i].position.y = 0;


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

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this