ccdemos/common_ply.h
branchpyrit
changeset 41 c1080cb5bd6d
parent 39 7079dcc3bd74
child 69 303583d2fb97
equal deleted inserted replaced
40:929aad02c5f2 41:c1080cb5bd6d
    69 		vertex_face_num.at(v3)++;
    69 		vertex_face_num.at(v3)++;
    70 		f.ignore(1000,'\n');
    70 		f.ignore(1000,'\n');
    71 	}
    71 	}
    72 
    72 
    73 	for (int i = 0; i < vertex_num; i++)
    73 	for (int i = 0; i < vertex_num; i++)
    74 	{
    74 		if (vertex_face_num.at(i))
    75 		normals.at(i) /= vertex_face_num.at(i);
    75 		{
    76 		normals.at(i).normalize();
    76 			normals.at(i) /= vertex_face_num.at(i);
    77 		vertices.at(i)->N = normals.at(i);
    77 			normals.at(i).normalize();
    78 	}
    78 			vertices.at(i)->N = normals.at(i);
       
    79 		}
    79 
    80 
    80 	f.close();
    81 	f.close();
    81 }
    82 }