12 mat.setSmooth(True) |
12 mat.setSmooth(True) |
13 LoadStanfordPlyFile(rt, "../models/ply/dragon/dragon_vrip_res2.ply", |
13 LoadStanfordPlyFile(rt, "../models/ply/dragon/dragon_vrip_res2.ply", |
14 mat, scale=(-29.0, 29.0, -29.0), trans=(0.0, -3.6, 0.0)) |
14 mat, scale=(-29.0, 29.0, -29.0), trans=(0.0, -3.6, 0.0)) |
15 |
15 |
16 light1 = Light(position=(-5.0, 2.0, 8.0), colour=(0.9, 0.3, 0.2)) |
16 light1 = Light(position=(-5.0, 2.0, 8.0), colour=(0.9, 0.3, 0.2)) |
17 rt.addlight(light1) |
17 rt.addLight(light1) |
18 |
18 |
19 light2 = Light(position=(3.0, 0.0, 9.0), colour=(0.0, 1.0, 0.2)) |
19 light2 = Light(position=(3.0, 0.0, 9.0), colour=(0.0, 1.0, 0.2)) |
20 rt.addlight(light2) |
20 rt.addLight(light2) |
21 |
21 |
22 imagesize = (800, 600) |
22 imagesize = (800, 600) |
23 data = rt.render(imagesize) |
23 data = rt.render(imagesize) |
24 img = Image.fromstring("RGB", imagesize, data) |
24 img = Image.fromstring("RGB", imagesize, data) |
25 img.save('dragon.png') |
25 img.save('dragon.png') |