allpolys.append(uscoll2_out_down) allpolys.append(dscoll1_up) allpolys.append(dscoll1_down) allpolys.append(dscoll2_up) allpolys.append(dscoll2_down) allpolys.append(dscoll2_out_down) allpolys.append(quartz1) allpolys.append(quartz2) 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()
#print sources #print allpolys print "Starting" 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) #print "Ghost intersections:" # Print out ghost region values #for aghost in [ghost1a, ghost1b, smallghost1]: # for aface in aghost.faces: # print "Of ", aface.v1[0], aface.v1[1], " -> ", aface.v2[0], aface.v2[1] # for lface in aface.getlitfaces(): # print "\t", lface.v1[0], lface.v1[1], " -> ", lface.v2[0], lface.v2[1] mydraw = drawlight(allpolys + sources) Gtk.main()
#!/usr/bin/python from poly import polygon from poly import face from gi.repository import Gtk from drawlight import drawlight mypoly1 = polygon( ([0,0.5], [1.0 ,0.5] , [1.0 ,0.51], [0 ,0.51]) ) mypoly2 = polygon( ([2,0], [3, 0], [3,1], [2,1]) ) print mypoly1.pts print mypoly2.pts mypoly2.light( [mypoly1], () ) for aface in mypoly2.faces: print [aface.v1, aface.v2], aface.lit1 if aface.getlitfaces(): for lface in aface.getlitfaces(): print lface.v1, lface.v2 print "" mydraw = drawlight( [mypoly1, mypoly2] ) Gtk.main()