I have a function(in some library) whose signature is this:
extern LIB3DSAPI void lib3ds_mesh_calculate_face_normals(Lib3dsMesh *mesh, float (*face_normals)[3]);
what does it expect in second argument?
I tried this:
float *norm_verts[3];
norm_verts=(float(*)[3])malloc(3*sizeof(float[3])*mesh->nfaces);
lib3ds_mesh_calculate_face_normals(mesh, norm_faces);
on the second line, it says Expression must be modifiable value and the third line says argument of type float** is incompatible with parameter of type float(*)[3]
My intuition was that float* [3] is just 3 pointers but why the hell is the * wrapped in brackets?
lib3ds_mesh_calculate_face_normalscalculates normals per face which would need an array of same size and there's another function to calculate per vertex normals which takes an array thrice as big. So I messed up while copying the code..:)