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 librenderables/renderab...


From: Janne V. Kujala
Subject: [Gzz-commits] gzz/gfx demo/fisheye.py librenderables/renderab...
Date: Thu, 12 Sep 2002 14:44:11 -0400

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

Modified files:
        gfx/demo       : fisheye.py 
        gfx/librenderables: renderables.py 

Log message:
        Add grid size parameters to fisheye

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/fisheye.py.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.23&tr2=1.24&r1=text&r2=text

Patches:
Index: gzz/gfx/demo/fisheye.py
diff -c gzz/gfx/demo/fisheye.py:1.15 gzz/gfx/demo/fisheye.py:1.16
*** gzz/gfx/demo/fisheye.py:1.15        Thu Sep 12 13:30:55 2002
--- gzz/gfx/demo/fisheye.py     Thu Sep 12 14:44:11 2002
***************
*** 72,78 ****
      if showpdf:
          addpdftex(pap)
  
!     pfq = GZZGL.createFisheyePaperQuad(pap, -1, -1, 1, 1)
  
      return pfq
  
--- 72,78 ----
      if showpdf:
          addpdftex(pap)
  
!     pfq = GZZGL.createFisheyePaperQuad(pap, -1, -1, 1, 1, gridsize, gridsize)
  
      return pfq
  
***************
*** 84,89 ****
--- 84,90 ----
  bm = 2
  px, py = 625, 400
  ps = 1
+ gridsize=16
  
  rng = java.util.Random()
  
***************
*** 110,115 ****
--- 111,117 ----
  
      def key(self, k):
          global bx, by, bs, ba, bl, bm, px, py, ps
+         global gridsize
          if k == "Up": py += 50
          elif k == "Down": py -= 50
          elif k == "Left": px += 50
***************
*** 130,135 ****
--- 132,139 ----
          elif k == "L": bl -= .1; print "bl ", bl
          elif k == "m": bm += .5; print "bm ", bm
          elif k == "M": bm -= .5; print "bm ", bm
+         elif k == "g": gridsize *= 2; print "gridsize", gridsize; 
self.initpaper()
+         elif k == "G": gridsize /= 2; print "gridsize", gridsize; 
self.initpaper()
        elif k == "v":
              self.seed = rng.nextInt(2000000000)
              self.initpaper()
Index: gzz/gfx/librenderables/renderables.py
diff -c gzz/gfx/librenderables/renderables.py:1.23 
gzz/gfx/librenderables/renderables.py:1.24
*** gzz/gfx/librenderables/renderables.py:1.23  Thu Sep 12 11:53:12 2002
--- gzz/gfx/librenderables/renderables.py       Thu Sep 12 14:44:11 2002
***************
*** 421,429 ****
  {
      "Type" : "2",
      "Name": "FisheyePaperQuad",
!     "Data": "Paper::Paper* paper; float x0, y0, x1, y1;",
      "Params" : """
!           Paper paper, float x0, float y0, float x1, float y1
        """,
      "ParamCode" : """
            this->paper = paper;
--- 421,429 ----
  {
      "Type" : "2",
      "Name": "FisheyePaperQuad",
!     "Data": "Paper::Paper* paper; float x0, y0, x1, y1; int gridx, gridy;",
      "Params" : """
!           Paper paper, float x0, float y0, float x1, float y1, int gridx, int 
gridy
        """,
      "ParamCode" : """
            this->paper = paper;
***************
*** 431,436 ****
--- 431,438 ----
              this->y0 = y0;
              this->x1 = x1;
              this->y1 = y1;
+             this->gridx = gridx;
+             this->gridy = gridy;
        """,
      "RenderCode" : """
            DBG(dbg) << "Paper\\n";
***************
*** 473,480 ****
                if (dbg) cout << "Pass\\n";
                (*it).setUpVP(&lightParam);
  
!                 float xstep = (x1 - x0) / 16;
!                 float ystep = (y1 - y0) / 16;
  
                  for (float y_ = y0; y_ + ystep <= y1; y_ += ystep) {
                  glBegin(GL_QUAD_STRIP);
--- 475,482 ----
                if (dbg) cout << "Pass\\n";
                (*it).setUpVP(&lightParam);
  
!                 float xstep = (x1 - x0) / gridx;
!                 float ystep = (y1 - y0) / gridy;
  
                  for (float y_ = y0; y_ + ystep <= y1; y_ += ystep) {
                  glBegin(GL_QUAD_STRIP);




reply via email to

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