/[gzz]/gzz/gfx/demo/paper/combiners.py
ViewVC logotype

Diff of /gzz/gfx/demo/paper/combiners.py

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

revision 1.3 by tjl, Mon Dec 23 10:34:51 2002 UTC revision 1.4 by tjl, Sun Dec 29 20:33:12 2002 UTC
# Line 8  from gfx.util import misc Line 8  from gfx.util import misc
8    
9  class Scene:  class Scene:
10      """Show some basis textures and what the NV10 register combiners can do with them.      """Show some basis textures and what the NV10 register combiners can do with them.
11    
12        The small squares show the randomly selected colors used in the real outputs.
13        The text shows the combiner code currently used for the intersection.
14      """      """
15      def __init__(self):      def __init__(self):
16          self.bgcolor = (0.7, 0.8, 0.6)          self.bgcolor = (0.7, 0.8, 0.6)
# Line 19  class Scene: Line 22  class Scene:
22          self.key = KeyPresses(self,          self.key = KeyPresses(self,
23  ListIndex("ccind", "combinercodes", 0, "combiner code for intersection region", "<", ">",  ListIndex("ccind", "combinercodes", 0, "combiner code for intersection region", "<", ">",
24                      noAnimation = 1),                      noAnimation = 1),
25    *self.pt.keys
26          )          )
27          # else:          # else:
28          #     self.pt.key(k)          #     self.pt.key(k)
# Line 26  ListIndex("ccind", "combinercodes", 0, " Line 30  ListIndex("ccind", "combinercodes", 0, "
30      def scene(self, vs):      def scene(self, vs):
31          putnoc(vs, background(self.bgcolor))          putnoc(vs, background(self.bgcolor))
32    
33          cs = vs.orthoCS(0, "S1", 0, 100, 100, 200, 200)          cs = vs.orthoCS(0, "S1", 0, 50, 50, 400, 400)
34          self.pt.place(vs, cs, "RGB0", self.combinercodes[self.ccind], "RGB1")          self.pt.place(vs, cs, "RGB0", self.combinercodes[self.ccind], "RGB1")
35    
36          for i in range(0,3):          for i in range(0,3):
37              cs = vs.coords.affineCoordsys(0, 10, 600 + (i-1)*150, 80, 50, 0, 0, 50)              cs = vs.coords.affineCoordsys(0, 10, 700 + (i-1)*80, 80, 50, 0, 0, 50)
38              vs.matcher.add(cs, "col" + str(i))              vs.matcher.add(cs, "col" + str(i))
39              col = self.pt.cols[i].split()              col = self.pt.cols[i].split()
40              cq = coloredQuad((col[0], col[1], col[2]))              cq = coloredQuad((col[0], col[1], col[2]))
41              vs.map.put(cq, cs)              vs.map.put(cq, cs)
42              vs.map.put(self.pt.frame, cs)              vs.map.put(self.pt.frame, cs)
43    
44          tcs = vs.orthoCS(0, "TXT", 0, 500, 300, 1, 1)          tcs = vs.orthoCS(0, "TXT", 0, 650, 300, 1, 1)
45          vs.map.put(getDListNocoords("""          vs.map.put(getDListNocoords("""
46              Disable REGISTER_COMBINERS_NV              Disable REGISTER_COMBINERS_NV
47              Color 0 0 0 1              Color 0 0 0 1
48              Disable ALPHA_TEST              Disable ALPHA_TEST
49              Enable TEXTURE_2D              Enable TEXTURE_2D
50          """))          """))
51          misc.putMultilineText (vs, tcs, texcodes[self.combinercodes[self.ccind]], 20)          misc.putMultilineText (vs, tcs, texcodes[self.combinercodes[self.ccind]], 15)

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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