/[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.1 by tjl, Thu Sep 26 10:02:52 2002 UTC revision 1.2 by tjl, Thu Sep 26 11:01:47 2002 UTC
# Line 1  Line 1 
1    
2  class HierarchScene:  class HierarchScene:
3      def __init__(self):      def __init__(self):
4          self.angles = [0, 60]          self.angles = [0, 60, 180, 270]
5      def key(self, key):      def key(self, key):
6          if key == 'a':          if key == 'a':
7              rotatelist(self.angles)              rotatelist(self.angles)
# Line 9  class HierarchScene: Line 9  class HierarchScene:
9          vs.map.put(background((0.3, 0.4, 0.1)))          vs.map.put(background((0.3, 0.4, 0.1)))
10                    
11          angle = self.angles[0]          angle = self.angles[0]
12            print angle
13    
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, 400, 400, 100, 100)
17    
18            cs02 = vs.coords.coordsys(cs0, -5, 0.5, 0.5, 4, 4)
19    
20            vs.matcher.add(cs0, "0")
21            vs.matcher.add(cs1, "1")
22            vs.matcher.add(cs2, "2")
23            vs.matcher.add(cs02, "02")
24            # vs.matcher.addSub(cs0, cs1, "1")
25            # vs.matcher.addSub(cs1, cs2, "2")
26            # vs.matcher.addSub(cs0, cs02, "3")
27    
28            vs.map.put(coloredQuad((0.1,0.1,0.1)), cs0)
29          vs.map.put(coloredQuad((1,0.1,0.1)), cs1)          vs.map.put(coloredQuad((1,0.1,0.1)), cs1)
30            vs.map.put(coloredQuad((1,1,0.1)), cs2)
31    
32            vs.map.put(coloredQuad((1,1,0.6)), cs02 )
33    
34    
35    
36  currentScene = HierarchScene()  currentScene = HierarchScene()

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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