equal
deleted
inserted
replaced
3 from pyrit import * |
3 from pyrit import * |
4 |
4 |
5 rt = Raytracer() |
5 rt = Raytracer() |
6 top = KdTree() |
6 top = KdTree() |
7 rt.setTop(top) |
7 rt.setTop(top) |
8 rt.setCamera(Camera()) |
8 rt.setCamera(Camera(eye=(0,1,6))) |
9 |
9 |
10 light1 = Light(position=(0.0, 5.0, -5.0), colour=(0.7, 0.3, 0.6)) |
10 light1 = Light(position=(0.0, 5.0, -5.0), colour=(0.7, 0.3, 0.6)) |
11 rt.addLight(light1) |
11 rt.addLight(light1) |
12 |
12 |
13 light2 = Light(position=(-2.0, 10.0, -2.0), colour=(0.4, 0.6, 0.3)) |
13 light2 = Light(position=(-2.0, 10.0, -2.0), colour=(0.4, 0.6, 0.3)) |
31 rt.addShape(tinysphere) |
31 rt.addShape(tinysphere) |
32 |
32 |
33 top.optimize() |
33 top.optimize() |
34 |
34 |
35 sampler = DefaultSampler(800, 600) |
35 sampler = DefaultSampler(800, 600) |
|
36 sampler.setOversample(1) |
36 rt.setSampler(sampler) |
37 rt.setSampler(sampler) |
37 rt.render() |
38 rt.render() |
38 sampler.getPixmap().writePNG('spheres_shadow.png') |
39 sampler.getPixmap().writePNG('spheres_shadow.png') |