/[gzz]/gzz/gfx/demo/papertest.py
ViewVC logotype

Diff of /gzz/gfx/demo/papertest.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.52 by tjl, Fri Nov 22 15:57:31 2002 UTC revision 1.53 by tjl, Sat Nov 23 19:03:35 2002 UTC
# Line 381  class DummyScene: Line 381  class DummyScene:
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    
# Line 417  if not globals().has_key("window_resized Line 433  if not globals().has_key("window_resized
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    

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.53

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26