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

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

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

revision 1.3 by tjl, Thu Sep 26 11:27:58 2002 UTC revision 1.4 by tjl, Thu Sep 26 11:39:10 2002 UTC
# Line 1  Line 1 
1    
2  class HierarchScene:  class HierarchScene:
3      def __init__(self):      def __init__(self):
4          self.angles = [0, 60, 180, 270]          self.angles = [0, 10, 30, 60]
5      def key(self, key):      def key(self, key):
6          if key == 'a':          if key == 'a':
7              rotatelist(self.angles)              rotatelist(self.angles)
# Line 14  class HierarchScene: Line 14  class HierarchScene:
14          cs0 = vs.coords.coordsys(0, 10, 400, 400, 100, 100)          cs0 = vs.coords.coordsys(0, 10, 400, 400, 100, 100)
15          cs1 = vs.coords.rotateXY(cs0, angle)          cs1 = vs.coords.rotateXY(cs0, angle)
16          cs2 = vs.coords.coordsys(cs1, 10, 0, 0, 4, 4)          cs2 = vs.coords.coordsys(cs1, 10, 0, 0, 4, 4)
17            cs3 = vs.coords.coordsys(cs2, -15, -1, -1, 2, 2)
18          cs02 = vs.coords.coordsys(cs0, 0, 0, 0, 8, 8)          cs4 = vs.coords.rotateXY(cs3, angle)
19    
20          vs.matcher.add(cs0, "0")          vs.matcher.add(cs0, "0")
21          vs.matcher.add(cs1, "1")          vs.matcher.add(cs1, "1")
22          vs.matcher.add(cs2, "2")          vs.matcher.add(cs2, "2")
23          vs.matcher.add(cs02, "02")          vs.matcher.add(cs3, "3")
24          # vs.matcher.addSub(cs0, cs1, "1")          vs.matcher.add(cs4, "4")
         # vs.matcher.addSub(cs1, cs2, "2")  
         # vs.matcher.addSub(cs0, cs02, "3")  
25    
26          vs.map.put(coloredQuad((0.1,0.1,0.1)), cs0)          vs.map.put(coloredQuad((0.1,0.1,0.1)), cs0)
27          vs.map.put(coloredQuad((1,0.1,0.1)), cs1)          vs.map.put(coloredQuad((1,0.1,0.1)), cs1)
28          vs.map.put(coloredQuad((1,1,0.1)), cs2)          vs.map.put(coloredQuad((1,1,0.1)), cs2)
29            vs.map.put(coloredQuad((0,1,0.1)), cs4)
30    
         vs.map.put(coloredQuad((1,1,0.6)), cs02 )  
31    
32    
33    

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