The mesh library is awesome, but confusing.
- let say I have a 512*424 image (from kinect depth camera in my case)
- I make a 3D mesh from this, and then have 217088 vertices (512*424)
- I then make an index list for all the triangles, and get 1296918 indices (6*(512-1)*(424-1)) cool
now the confusion.
I can have 3 normals per triangle = 1 normal per index (i.e. 1296918), or 1 per triangle / face (i.e. 432306)
However
using mesh.getFaceNormals(true) I get 3890754 (which should be 432306…factor of 9 out !)
using mesh.getFaceNormals(false), I get 1296918 (perfect)
Is my understanding of getFaceNormals(true) incorrect?
it appears the function is making 3 copies of the same normal, instead of combining 3.
Also: How does OpenGL know that the normal is ver vertex or per face for shading?
OK, now for the 2nd part of this question.
Instead of allocating a color to each vertex, can I add a color to each index?
It appears I can only do this on a per vertex basis… how do I tell OpenGL which option to use?
Basically the same thinking as above for the normals, but now implemented in the colors?
I am trying to display the normals in terms of color, such that each Index (or face) has a color dependent on the normal (x,y,z = r,g,b).