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) |