-
Notifications
You must be signed in to change notification settings - Fork 3
/
showcolls.py
executable file
·47 lines (31 loc) · 1008 Bytes
/
showcolls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/python
from poly import polygon
from poly import face
from gi.repository import Gtk
from drawlight import drawlight
sources = []
allpolys = []
target = polygon( ([0,0.0], [1.0 ,0.0] , [1.0 ,0.01], [0 ,0.01]) )
mypoly2 = polygon( ([2,0], [3, 0], [3,1], [2,1]), isDetector=True )
mypoly3 = polygon( ([1.7, 0.1], [1.85, 0.1], [1.85,0.2], [1.7,0.2]) )
mypoly4 = polygon( ([1.7, 0.4], [1.8, 0.4], [1.8,1.0], [1.7,1.0]) )
mirror = polygon( ([1.5, -0.5], [1.6, -0.5], [1.6,-0.4], [1.5,-0.4]) )
sources.append(target)
allpolys.append(mypoly2)
allpolys.append(mypoly3)
allpolys.append(mypoly4)
allpolys.append(mirror)
print sources
print allpolys
for apoly in allpolys:
otherpolys = list(allpolys)
otherpolys.remove(apoly)
apoly.light( sources, otherpolys )
print "Doing once bounce lighting"
# One bounce
for apoly in allpolys:
otherpolys = list(allpolys)
otherpolys.remove(apoly)
apoly.light(otherpolys, [], 2 )
mydraw = drawlight(allpolys+sources)
Gtk.main()