Jump to content
  • Advertisement
Sign in to follow this  

Usage of D3D Index Buffers

This topic is 4955 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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.position.x = x;
      Vx.position.z = z;
      Vx.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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!