demos/triangles_monkey.py
branchpyrit
changeset 75 20dee9819b17
parent 62 07c2f8084719
child 90 f6a72eb99631
equal deleted inserted replaced
74:09aedbf5f95f 75:20dee9819b17
     7 rt = Raytracer()
     7 rt = Raytracer()
     8 mat = Material(colour=(0.9, 0.9, 0.9))
     8 mat = Material(colour=(0.9, 0.9, 0.9))
     9 LoadWavefrontObjFile(rt, "../models/obj/monkey.obj", mat, 1.5)
     9 LoadWavefrontObjFile(rt, "../models/obj/monkey.obj", mat, 1.5)
    10 
    10 
    11 light = Light(position=(-5.0, 2.0, 8.0), colour=(0.9, 0.3, 0.6))
    11 light = Light(position=(-5.0, 2.0, 8.0), colour=(0.9, 0.3, 0.6))
    12 rt.addlight(light)
    12 rt.addLight(light)
    13 
    13 
    14 imagesize = (800, 600)
    14 imagesize = (800, 600)
    15 data = rt.render(imagesize)
    15 data = rt.render(imagesize)
    16 img = Image.fromstring("RGB", imagesize, data)
    16 img = Image.fromstring("RGB", imagesize, data)
    17 img.save('triangles_monkey.png')
    17 img.save('triangles_monkey.png')