demos/triangles_sphere.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, "sphere.obj")
    27 LoadWavefrontObjFile(rt, mat, "sphere.obj")
    28 
    28 
    29 light1 = Light(position=(0.0, 2.0, -5.0), colour=(0.9, 0.3, 0.6))
    29 light1 = Light(position=(0.0, 2.0, 6.0), colour=(0.9, 0.3, 0.6))
    30 light1.castshadows(False);
    30 light1.castshadows(False);
    31 rt.addlight(light1)
    31 rt.addlight(light1)
    32 
    32 
    33 light2 = Light(position=(-2.0, -5.0, -7.0), colour=(0.7, 1.0, 0.3))
    33 light2 = Light(position=(-2.0, -5.0, 7.0), colour=(0.7, 1.0, 0.3))
    34 light2.castshadows(False);
    34 light2.castshadows(False);
    35 rt.addlight(light2)
    35 rt.addlight(light2)
    36 
    36 
    37 imagesize = (800, 600)
    37 imagesize = (800, 600)
    38 data = rt.render(imagesize)
    38 data = rt.render(imagesize)