我收到此错误,我无法弄清楚的原因。是类型问题吗?错误就行了:
“size = objmesh->n_objvertexdata * sizeof(vec3) * sizeof(vec3);”
不知道是什么,一直在折腾。帮助?
objmesh = &objmesh[0];
unsigned char *vertex_array = NULL,
*vertex_start = NULL;
unsigned int i = 0, index = 0, stride = 0, size = 0;
size = objmesh->n_objvertexdata * sizeof(vec3) * sizeof(vec3); //this lines gives error
vertex_array = (unsigned char *) malloc(size);
vertex_start = vertex_array;
while (i != objmesh->n_objvertexdata) {
index = objmesh->objvertexdata[i].vertex_index;
memcpy(vertex_array, &obj->indexed_vertex[index], sizeof(vec3));
vertex_array += sizeof(vec3);
memcpy(vertex_array, &obj->indexed_normal[index], sizeof(vec3));
vertex_array += sizeof(vec3);
++i;