Corrected splits and draws
This commit is contained in:
parent
8a38f66ce7
commit
589f12aeee
|
@ -75,7 +75,7 @@ class ModelParser:
|
|||
import OpenGL.GL as gl
|
||||
|
||||
gl.glColor3f(1.0,0.0,0.0)
|
||||
gl.glBegin(gl.GL_QUADS)
|
||||
gl.glBegin(gl.GL_TRIANGLES)
|
||||
for face in self.faces:
|
||||
v1 = self.vertices[face.a.vertex]
|
||||
v2 = self.vertices[face.b.vertex]
|
||||
|
|
|
@ -13,7 +13,10 @@ class OBJParser(ModelParser):
|
|||
self.materials = []
|
||||
|
||||
def parse_line(self, string):
|
||||
split = string.split(' ')
|
||||
if string == '':
|
||||
return
|
||||
|
||||
split = string.split()
|
||||
first = split[0]
|
||||
split = split[1:]
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ class PLYHeaderParser:
|
|||
self.parent = parent
|
||||
|
||||
def parse_line(self, string):
|
||||
split = string.split(' ')
|
||||
split = string.split()
|
||||
if string == 'ply':
|
||||
return
|
||||
|
||||
|
@ -60,7 +60,7 @@ class PLYContentParser:
|
|||
|
||||
def parse_line(self, string):
|
||||
|
||||
split = string.split(' ')
|
||||
split = string.split()
|
||||
|
||||
if self.current_element.name == 'vertex':
|
||||
self.parent.add_vertex(Vertex().from_array(split))
|
||||
|
|
Loading…
Reference in New Issue