381 |
cs1 = vs.coords.affineCoordsys(0, 10, 600, 500, 450, 0, 0, 450) |
cs1 = vs.coords.affineCoordsys(0, 10, 600, 500, 450, 0, 0, 450) |
382 |
vs.matcher.add(cs1, "1") |
vs.matcher.add(cs1, "1") |
383 |
|
|
384 |
putText(vs, cs1, "F1, F2", color=(0,0,0), h=.25) |
putText(vs, cs1, "F1, F2, F3", color=(0,0,0), h=.25) |
385 |
|
|
386 |
class BasisScene: |
class BasisScene: |
387 |
"""A scene showing all basis textures.""" |
"""A scene showing all basis textures.""" |
388 |
gfx.libpaper. |
def __init__(self): |
389 |
|
self.tex = gfx.libpaper.textures.init(3, "RGB")["RGB2"] |
390 |
|
def key(self, k): |
391 |
|
pass |
392 |
|
def scene(self, vs): |
393 |
|
vs.map.put(background((.7,.8,.7))) |
394 |
|
print self.tex |
395 |
|
(x,y) = (0,0) |
396 |
|
(w,h) = (150,150) |
397 |
|
sp = 10 |
398 |
|
for t in self.tex: |
399 |
|
vs.put(quad((t.getTexId())), 0, sp + x*(w+sp), sp + y*(h+sp), w, h) |
400 |
|
x += 1 |
401 |
|
if x>3: |
402 |
|
x = 0 |
403 |
|
y += 1 |
404 |
|
|
405 |
scenebindings = { |
scenebindings = { |
406 |
"F1": PaperScene, |
"F1": PaperScene, |
407 |
"F2": MultiPaperScene, |
"F2": MultiPaperScene, |
408 |
|
"F3": BasisScene, |
409 |
"F12": DummyScene, |
"F12": DummyScene, |
410 |
} |
} |
411 |
|
|
433 |
window_resized = 1 |
window_resized = 1 |
434 |
w.setLocation(0,0,1200,900) |
w.setLocation(0,0,1200,900) |
435 |
|
|
436 |
|
def r(sc, filename): |
437 |
|
vs = w.createVobScene() |
438 |
|
sc.scene(vs) |
439 |
|
w.renderStill(vs, 0) |
440 |
|
saveanim.saveframe(filename, w) |
441 |
|
|
442 |
def makeScreenshots(): |
def makeScreenshots(): |
443 |
ps = MultiPaperScene() |
ps = MultiPaperScene() |
444 |
ps.seed = 199871850 |
ps.seed = 199871850 |
445 |
ps.initpaper() |
ps.initpaper() |
446 |
vs = w.createVobScene() |
r(ps, "shots/multipaper.png") |
447 |
ps.scene(vs) |
|
448 |
w.renderStill(vs, 0) |
ps = BasisScene() |
449 |
saveanim.saveframe("shots/multipaper.png", w) |
r(ps, "shots/paperbasistex.png") |
450 |
|
|
451 |
|
|
452 |
|
|