gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gfx/librenderables renderables.py


From: Janne V. Kujala
Subject: [Gzz-commits] gzz/gfx/librenderables renderables.py
Date: Wed, 18 Sep 2002 05:19:00 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Janne V. Kujala <address@hidden>        02/09/18 05:19:00

Modified files:
        gfx/librenderables: renderables.py 

Log message:
        move bulge function in a function

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.44&tr2=1.45&r1=text&r2=text

Patches:
Index: gzz/gfx/librenderables/renderables.py
diff -c gzz/gfx/librenderables/renderables.py:1.44 
gzz/gfx/librenderables/renderables.py:1.45
*** gzz/gfx/librenderables/renderables.py:1.44  Wed Sep 18 04:04:05 2002
--- gzz/gfx/librenderables/renderables.py       Wed Sep 18 05:19:00 2002
***************
*** 434,439 ****
--- 434,450 ----
              this->gridx = gridx;
              this->gridy = gridy;
        """,
+     "ExtraClass" : """
+             inline ZPt bulge(ZPt& v) const {
+                 // Modulate distance from origin
+                 float t = (1 + v.x * v.x + v.y * v.y);
+                 float m = 1 + v.z / t;
+                 return ZPt(m * v.x, m * v.y, v.z);
+             }
+             ZPt bulge_inv(ZPt& p) const {
+                 // XXX
+             }
+     """,
      "RenderCode" : """
            DBG(dbg) << "Paper\\n";
            GLERR
***************
*** 444,491 ****
  
              AffineCoords cs2inv = coords2.getInverse();
  
-             #if 0
-             {
-                 /* Find out where the corners will be in
-                  * non-distorted paper coordinates when distorted
-                  */
-                 ZPt p[4] = { coords1.transform(Pt(x0, y0)),
-                              coords1.transform(Pt(x0, y1)),
-                              coords1.transform(Pt(x1, y0)),
-                              coords1.transform(Pt(x1, y1)) };
-                 Pt q[4];
- 
-                 for (int i = 0; i < 4; i++) {
-                     float x = p[i].x, y = p[i].y;
- 
-                       ZPt pos = coords1.transform(Pt(x,y));
-                       float a = b0.dot(pos - borig);
-                       float b = b1.dot(pos - borig);
-                       float c = pos.z - borig.z;
- 
-                       // Modulate distance from coords2 origin
-                       float t = (1 + a * a + b * b);
-                       float m = 1 + c / t;
-                       m = 1;
-                       ZPt v = coords2.transform(ZPt(m*a, m*b, c));
- 
-                       q[i] = Pt(paperx.dot(v - paperorigin) *
-                                 (1 / (paperx.x * paperx.x + paperx.y * 
paperx.y)),
-                                 papery.dot(v - paperorigin) *
-                                 (1 / (papery.x * papery.x + papery.y * 
papery.y)));
-                 }
- 
-                 cout << Pt(x0,y0) << q[0] << "\\n";
-                 cout << Pt(x0,y1) << q[1] << "\\n";
-                 cout << Pt(x1,y0) << q[2] << "\\n";
-                 cout << Pt(x1,y1) << q[3] << "\\n";
- 
-                 // XXX: unfinished code
-             }
-             #endif
-             
- 
- 
            Paper::LightParam lightParam;
            lightParam.orig = paperorigin-ZPt(0,0,0);
            lightParam.e0 = paperx;
--- 455,460 ----
***************
*** 526,537 ****
                        
                        ZPt pos = coords1.transform(Pt(x,y));
                        ZPt v = cs2inv.transform(pos);
! 
!                       // Modulate distance from coords2 origin
!                       float t = (1 + v.x * v.x + v.y * v.y);
!                       float m = 1 + v.z / t;
! 
!                       coords2.vertex(ZPt(m*v.x, m*v.y, v.z));
                      }
                    }
                    glEnd();
--- 495,501 ----
                        
                        ZPt pos = coords1.transform(Pt(x,y));
                        ZPt v = cs2inv.transform(pos);
!                       coords2.vertex(bulge(v));
                      }
                    }
                    glEnd();




reply via email to

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