ccdemos/common_ply.h
branchpyrit
changeset 41 c1080cb5bd6d
parent 39 7079dcc3bd74
child 69 303583d2fb97
--- a/ccdemos/common_ply.h	Mon Dec 17 22:03:50 2007 +0100
+++ b/ccdemos/common_ply.h	Tue Dec 18 12:36:01 2007 +0100
@@ -71,11 +71,12 @@
 	}
 
 	for (int i = 0; i < vertex_num; i++)
-	{
-		normals.at(i) /= vertex_face_num.at(i);
-		normals.at(i).normalize();
-		vertices.at(i)->N = normals.at(i);
-	}
+		if (vertex_face_num.at(i))
+		{
+			normals.at(i) /= vertex_face_num.at(i);
+			normals.at(i).normalize();
+			vertices.at(i)->N = normals.at(i);
+		}
 
 	f.close();
 }