On 3/27/2011 11:08 AM, Joris Huizer wrote:
But you are changing the values during the function:
+
+ for(i = 0; i< 24; i++)
+ {
+ vertices[6 * i ] *= width;
+ vertices[6 * i + 1] *= height;
+ vertices[6 * i + 2] *= depth;
+ }
+
On a side note, you could rearrange this loop to use less multiplications:
+ for(i = 0; i< 24; i++)
+ {
+ int sixi = 6 * i;
+ vertices[sixi ] *= width;
+ vertices[sixi + 1] *= height;
+ vertices[sixi + 2] *= depth;
+ }
Or even better:
+ for(i = 0; i< 144; i+=4)
+ {
+ vertices[i ] *= width;
+ vertices[++i] *= height;
+ vertices[++i] *= depth;
+ }