Comments for mesh normals calculation from Mortem Mikkelsen (aka sparky).

We hope it'll help for further workers in this area!
This commit is contained in:
Sergey Sharybin 2011-04-01 18:35:49 +00:00
parent 18fd4d3137
commit d40b0dfb75
2 changed files with 4 additions and 0 deletions

@ -1301,6 +1301,8 @@ void mesh_calc_normals(MVert *mverts, int numVerts, MFace *mfaces, int numFaces,
} }
/* build smooth normals for uninitialized normals at faces set to flat */ /* build smooth normals for uninitialized normals at faces set to flat */
/* For such faces the renderer/3Dview and exporters will be using the face normal */
/* The vertex normals built inside this if-statement are entirely to support the needs of the modeler */
if(found_flat!=0) { if(found_flat!=0) {
const int nr_bits= sizeof(int)*8; const int nr_bits= sizeof(int)*8;
const int nr_words= (numVerts+(nr_bits-1))/nr_bits; const int nr_words= (numVerts+(nr_bits-1))/nr_bits;

@ -2028,6 +2028,8 @@ void recalc_editnormals(EditMesh *em)
} }
/* build smooth normals for uninitialized normals at faces set to flat */ /* build smooth normals for uninitialized normals at faces set to flat */
/* For such faces the renderer/3Dview and exporters will be using the face normal */
/* The vertex normals built inside this if-statement are entirely to support the needs of the modeler */
if(found_flat!=0) { if(found_flat!=0) {
for(efa= em->faces.first; efa; efa=efa->next) { for(efa= em->faces.first; efa; efa=efa->next) {
efa->v1->tmp.t= 0; efa->v1->tmp.t= 0;