demos/buddha.py
branchpyrit
changeset 28 ffe83ca074f3
parent 24 d0d76e8a5203
child 29 574c34441a1c
equal deleted inserted replaced
27:e9bb83c2b8b9 28:ffe83ca074f3
    34 	while (face_num):
    34 	while (face_num):
    35 		tokens = fp.readline().split()
    35 		tokens = fp.readline().split()
    36 		if (tokens[0] != "3"):
    36 		if (tokens[0] != "3"):
    37 			print "ply warning: faces of %d vertices not supported" % tokens[0]
    37 			print "ply warning: faces of %d vertices not supported" % tokens[0]
    38 		f = [vertices[int(x)] for x in tokens[1:4]]
    38 		f = [vertices[int(x)] for x in tokens[1:4]]
    39 		face = Triangle(f[0], f[1], f[2], mat)
    39 		face = Triangle(NormalVertex(f[0]), NormalVertex(f[1]), NormalVertex(f[2]), mat)
    40 		rt.addshape(face)
    40 		rt.addshape(face)
    41 		face_num -= 1
    41 		face_num -= 1
    42 
    42 
    43 rt = Raytracer()
    43 rt = Raytracer()
    44 mat = Material(colour=(0.9, 0.9, 0.9))
    44 mat = Material(colour=(0.9, 0.9, 0.9))