Angelus-

Angelus-

  • NA
  • 3
  • 0

c# DirectX Index Buffer Problems

May 4 2005 6:04 PM
Hi, i've got some very wierd index buffer problems, say i have a vertex buffer with the following data: vertices[0].Z = 40;//3 vertices[0].Y = 0; vertices[0].X = 40; vertices[1].Z = 20;//1 vertices[1].Y =0; vertices[1].X = 40; vertices[2].Z = 20; vertices[2].Y = 0;//0 vertices[2].X = 20; vertices[3].Z = 40;//2 vertices[3].Y = 0; vertices[3].X = 20; and an index buffer with the following data: indices[0]=0; indices[1]=1; indices[2]=2; indices[3]=2; indices[4]=3; indices[5]=0; This is working fine and displaying a nice square on the screen. However if i change the length of the vertex buffer to say 24 (0 to 23) and set all the onces after 3 to x=20,y=0,z=20 then picked say number 22 which is 20,0,20 and set indices[2] and [3] to equal 22 then the square dissapears, same vertex contents yet for some reason it does not render,if i wireframe it i see 2 lines of the square the top one and the right one. So basicaly vertex number 2 = 20,0,20 and vertex 22 = 20,0,20 so why wont it render the square?!?!!? Am asking this because it is leading to massive problems in my program and this is what i've boiled it down to. Why is it doing this?!?!?!?!?!?