Quote:Original post by Aryabhatta
Your problem could be with this line of code:
n->vert_array[pos*9+i] = arr;
what values does pos*9 + i take?
vert_array is an array of GLFloats. The size of the array is 9.
You might be accessing memory locations way beyond the bounds of the array.
Also you are sure it is the new Glfloat.. line which is causing the problem?
Did you try turning optimizations off and debugging this on a debug version?
pos is the number of faces, and helps me with finding the last elements of the array. when its multiplied by 9 (3 vertices with 3 values (x, y, z)) it gives the proper offset with pos. i is just an iterator.
arr is always an array with 9 GLfloats in it.
when i run it pos is correct.
i also have all optimizations off.
i guess im going to try and do everything in std::vector and then when its done ill pass everything in a dynamic array and then into the vertex array.