• Content count

  • Joined

  • Last visited

Community Reputation

138 Neutral

About kyle.brechin

  • Rank
  1. Vertices assignment confusing

    Wonderful answer, very informative and explanatory, as well as in-depth. I've yet to check out Reimer's tutorials, though I've had the page book marked for a while, I'll have to check that out shortly. I'm unsure why he drew 6 points, when two were the same location and it would save space. I gather the assignment of the values is pretty much to mark which vertices have the same points to put them into the vertex buffer? indices[0] and indeces[3] are the same point in the rectangle, and thus have the value 0. (top left) indices[1] and indeces[5] are the same point in the rectangle, and thus have the value 1. (bottom right) indices[2] has a value of 2, being the only vertex at that point. (bottom left) indices[4] has a value of 3, being the only vertex at that point. (top right) That's pretty much where it stops making sense. I'll have to toy around with the process and maybe read more about the API and how it handles this whole process. I'll have to read more on the vertex buffer, as the book has only covered the index buffer. I must say I'm not a a fan of these books, they don't get into the information as much as I'd like them to, but they're helpful nonetheless. Thanks again for your answer!
  2. I'm trying to understand what the point of assigning these values to the indices are. He's simple using two triangles to create a rectangle on the screen which is simple enough to understand, but the InitializeIndices() method confuses me because I don't understand why he's assigning the value. I also understand that he's adding the vetices in a clockwise manner It's from Sams Microsoft xna unleashed (isbn 978-0-672-23964-7) Ignore any typos or small syntax errors, im on my phone. In LoadGraphicsContent: [source] private void InitializeIndices() { indices = new short[6]; Indices[0] = 0; indices[1] = 1; indices[2] = 2; Indices[3] = 0; indices[4] = 3; indices[5] = 1; } [/source] If any more code is needed, just let me know. Im looking for the "why" answer. I just cant understand it without knowing how it works.