Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#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