Changed operation order, normalise vectors before computing normals
This commit is contained in:
@@ -218,6 +218,8 @@ class ModelParser:
|
||||
for face in part.faces:
|
||||
v1 = Vertex.from_points(self.vertices[face.a.vertex], self.vertices[face.b.vertex])
|
||||
v2 = Vertex.from_points(self.vertices[face.a.vertex], self.vertices[face.c.vertex])
|
||||
v1.normalize()
|
||||
v2.normalize()
|
||||
cross = Vertex.cross_product(v1, v2)
|
||||
self.normals[face.a.vertex] += cross
|
||||
self.normals[face.b.vertex] += cross
|
||||
|
||||
@@ -189,6 +189,9 @@ class PLY_ASCII_ContentParser:
|
||||
|
||||
def parse_line(self, string):
|
||||
|
||||
if string == '':
|
||||
return
|
||||
|
||||
if self.current_element is None:
|
||||
self.current_element = self.parent.elements[0]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user