gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/gfx/demo fisheye.py


From: Janne V. Kujala
Subject: [Gzz-commits] gzz/gfx/demo fisheye.py
Date: Wed, 11 Sep 2002 09:44:54 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Janne V. Kujala <address@hidden>        02/09/11 09:44:54

Modified files:
        gfx/demo       : fisheye.py 

Log message:
        Add keys for changing bulge angle and shape

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/fisheye.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gzz/gfx/demo/fisheye.py
diff -c gzz/gfx/demo/fisheye.py:1.2 gzz/gfx/demo/fisheye.py:1.3
*** gzz/gfx/demo/fisheye.py:1.2 Wed Sep 11 09:18:16 2002
--- gzz/gfx/demo/fisheye.py     Wed Sep 11 09:44:54 2002
***************
*** 11,16 ****
--- 11,18 ----
  bx = 600
  by = 450
  bs = .15
+ ba = 0
+ bl = 0
  
  rng = java.util.Random()
  
***************
*** 24,36 ****
          self.fpq = getfisheyepaper(self.seed);
  
      def key(self, k):
!         global bx, by, bs
          if k == "Up": by -= 100
          elif k == "Down": by += 100
          elif k == "Left": bx -= 100
          elif k == "Right": bx += 100
          elif k == "+": bs += .05
          elif k == "-": bs -= .05
        elif k == "v":
              self.seed = rng.nextInt(2000000000)
              self.initpaper()
--- 26,42 ----
          self.fpq = getfisheyepaper(self.seed);
  
      def key(self, k):
!         global bx, by, bs, ba, bl
          if k == "Up": by -= 100
          elif k == "Down": by += 100
          elif k == "Left": bx -= 100
          elif k == "Right": bx += 100
          elif k == "+": bs += .05
          elif k == "-": bs -= .05
+         elif k == "a": ba += .2
+         elif k == "A": ba -= .2
+         elif k == "l": bl += .1
+         elif k == "L": bl -= .1
        elif k == "v":
              self.seed = rng.nextInt(2000000000)
              self.initpaper()
***************
*** 41,47 ****
  
        cs1 = vs.coords.affineCoordsys(0, "1", 10, 600, 450, 400, 0, 0, 400)
  
!       cs2 = vs.coords.affineCoordsys(0, "2", 10, bx, by, bs*400, 0, 0, bs*400)
  
        vs.map.put(self.fpq, cs1, cs2)
  
--- 47,57 ----
  
        cs1 = vs.coords.affineCoordsys(0, "1", 10, 600, 450, 400, 0, 0, 400)
  
!       cs2 = vs.coords.affineCoordsys(0, "2", 10, bx, by, 
!                                        400 * bs * math.exp(+bl) * 
math.cos(ba),
!                                        400 * bs * math.exp(+bl) * 
math.sin(ba),
!                                        400 * bs * math.exp(-bl) 
*-math.sin(ba),
!                                        400 * bs * math.exp(-bl) * 
math.cos(ba))
  
        vs.map.put(self.fpq, cs1, cs2)
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]