Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualBrother Bob

Posted 02 June 2013 - 09:24 AM

Your buffer does not index vertices, but individual components of the vertices. That is evident from the fact that you need to fetch each component by itself with consecutive indices. For that reason, the vertex n is not located at index n, but at index 3*n, 3*n+1 and 3*n+2.

 

edit: Look at it this way. If you add one to the indices in the code you posted, you will not end up with the vertices shifted one step. You will end up with the value of y1 in x1, x1 on y1, x2 in z1, and so on. To shift complete vertices, you need to shift x2 into x1, y2 into y1, and so on, and that is achieved by adding three to your indices, not by adding one.


#1Brother Bob

Posted 02 June 2013 - 09:21 AM

Your buffer does not index vertices, but individual components of the vertices. That is evident from the fact that you need to fetch each component by itself with consecutive indices. For that reason, the vertex n is not located at index n, but at index 3*n, 3*n+1 and 3*n+2.


PARTNERS