Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

billybob

index buffer problem

This topic is 5983 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

i have this code to set up the vertice grid for my terrain: for(yread = 1; yread < terrain_y - 2; yread++) { tay = tay + terrain_Tex; tax = 0; for(xread = 1; xread 2) { tVertBuf[vert] = IndexXY(xread, yread); tVertBuf[vert + 2] = IndexXY(xread+1, yread); tVertBuf[vert + 1] = IndexXY(xread+1, yread+1); tVertBuf[vert + 3] = IndexXY(xread, yread); tVertBuf[vert + 4] = IndexXY(xread, yread+1); tVertBuf[vert + 5] = IndexXY(xread+1, yread+1); vert = vert + 6; } else { tVertBuf[vert] = 5; tVertBuf[vert + 2] = 6; tVertBuf[vert + 1] = 7; tVertBuf[vert + 3] = 5; tVertBuf[vert + 4] = 6; tVertBuf[vert + 5] = 7; vert = vert + 6; } no matter what i do, there are always triangles i didn''t create going from the edges of the terrain to 0,0,0 in world space. the ''if xread''s'' are to try and cut off the edges of the terrain, but the triangles keep being created from the ''new'' edge. if i leave that code out, it makes trianlges from one side of the terrain, to the other. if drawIndexedPrimitve gets a triangle that doesn''t ahve a vertice set, what will it do? this may be my problem, but i don''t think so.

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!