15 |
|
|
16 |
aspect = float(xs)/ys |
aspect = float(xs)/ys |
17 |
|
|
18 |
|
textblock = "011D75251F04C8BF89A44C88D875886B2B5172522A" |
19 |
|
|
20 |
def getpaper(seed, opts): |
def getpaper(seed, opts): |
21 |
pap = ThePaperMill().getPaper(seed, **opts) |
pap = ThePaperMill().getPaper(seed, **opts) |
22 |
return GLRen.createPaperQuad(pap, -aspect/2, -.5, aspect/2, .5, 0) |
return GLRen.createPaperQuad(pap, -aspect/2, -.5, aspect/2, .5, 0) |
32 |
pq = getpaper(seed, opts) |
pq = getpaper(seed, opts) |
33 |
vs.map.put(pq, cs1, cs2) |
vs.map.put(pq, cs1, cs2) |
34 |
return vs |
return vs |
35 |
|
|
36 |
|
def createPurePapers(): |
37 |
|
seed = 100 |
38 |
|
for opts in [ |
39 |
|
{ "numcolors" : 8, "minlum" : 80 }, |
40 |
|
{ "numcolors" : 8, "minlum" : 94 }, |
41 |
|
{ "numcolors" : 1, "minlum" : 80 }, |
42 |
|
]: |
43 |
|
for i in range(0,30): |
44 |
|
vs = w.createVobScene() |
45 |
|
paperscene(vs, seed, opts) |
46 |
|
w.renderStill(vs, 0) |
47 |
|
saveanim.saveframe("/tmp/tmp%s.png" % seed, w) |
48 |
|
java.lang.System.gc() |
49 |
|
GL.freeQueue() |
50 |
|
|
51 |
|
seed += 1 |
52 |
|
|
53 |
|
|
54 |
class Main(Runnable): |
class Main(Runnable): |
55 |
|
|
56 |
def run(self): |
def run(self): |
57 |
global ThePaperMill |
global ThePaperMill, w |
58 |
from gfx.libpaper.papermill import ThePaperMill |
from gfx.libpaper.papermill import ThePaperMill |
59 |
|
|
60 |
w = gfxapi.createWindow() |
w = gfxapi.createWindow() |
61 |
w.setLocation(0,0,xs,ys) |
w.setLocation(0,0,xs,ys) |
62 |
|
|
63 |
seed = 100 |
createPurePapers() |
|
for opts in [ |
|
|
{ "numcolors" : 8, "minlum" : 80 }, |
|
|
{ "numcolors" : 8, "minlum" : 94 }, |
|
|
{ "numcolors" : 1, "minlum" : 80 }, |
|
|
]: |
|
|
for i in range(0,30): |
|
|
vs = w.createVobScene() |
|
|
paperscene(vs, seed, opts) |
|
|
w.renderStill(vs, 0) |
|
|
saveanim.saveframe("/tmp/tmp%s.png" % seed, w) |
|
|
java.lang.System.gc() |
|
|
GL.freeQueue() |
|
|
|
|
|
seed += 1 |
|
|
|
|
|
|
|
64 |
|
|
65 |
|
|
66 |
gfxapi = GraphicsAPI.getInstance() |
gfxapi = GraphicsAPI.getInstance() |