demos/triangles_monkey.py
branchpyrit
changeset 19 4e0955fca797
parent 6 d8d596d26f25
child 22 76b7bd51d64a
equal deleted inserted replaced
18:25b7c445cf61 19:4e0955fca797
    24 
    24 
    25 rt = Raytracer()
    25 rt = Raytracer()
    26 mat = Material(colour=(0.9, 0.9, 0.9))
    26 mat = Material(colour=(0.9, 0.9, 0.9))
    27 LoadWavefrontObjFile(rt, mat, "monkey.obj")
    27 LoadWavefrontObjFile(rt, mat, "monkey.obj")
    28 
    28 
    29 light = Light(position=(-5.0, 2.0, -8.0), colour=(0.9, 0.3, 0.6))
    29 light = Light(position=(-5.0, 2.0, 8.0), colour=(0.9, 0.3, 0.6))
    30 rt.addlight(light)
    30 rt.addlight(light)
    31 
    31 
    32 imagesize = (800, 600)
    32 imagesize = (800, 600)
    33 data = rt.render(imagesize)
    33 data = rt.render(imagesize)
    34 img = Image.fromstring("RGB", imagesize, data)
    34 img = Image.fromstring("RGB", imagesize, data)