Jump to content
  • Advertisement


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


index buffer problem

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

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!