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: Fri, 27 Sep 2002 07:11:52 -0400

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

Modified files:
        gfx/librenderables: renderables.py 

Log message:
        Implement IrregularQuad dicing

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

Patches:
Index: gzz/gfx/librenderables/renderables.py
diff -c gzz/gfx/librenderables/renderables.py:1.69 
gzz/gfx/librenderables/renderables.py:1.70
*** gzz/gfx/librenderables/renderables.py:1.69  Fri Sep 27 06:52:11 2002
--- gzz/gfx/librenderables/renderables.py       Fri Sep 27 07:11:52 2002
***************
*** 620,628 ****
          double radius = (coords2.transform(ZPt(1,1,0)) - ZPt(0,0,0)).length();
          double nonl = coords1.nonlinearity(ctr, radius);
  
!         int diceb = (int)(2 * border * sqrt(2) * nonl) + 1;
!         int dicex = (int)(2 * border * (1 / bx - 1) * nonl) + 1;
!         int dicey = (int)(2 * border * (1 / by - 1) * nonl) + 1;
  
          // Dicing number for each of the primitives 
          int dice[] = { dicey, dicey, dicex, dicex, diceb, diceb, diceb, diceb 
};
--- 620,628 ----
          double radius = (coords2.transform(ZPt(1,1,0)) - ZPt(0,0,0)).length();
          double nonl = coords1.nonlinearity(ctr, radius);
  
!         int diceb = (int)fabs(2 * border * sqrt(2) * nonl) + 1;
!         int dicex = (int)fabs(2 * border * (1 / bx - 2) * nonl) + 1;
!         int dicey = (int)fabs(2 * border * (1 / by - 2) * nonl) + 1;
  
          // Dicing number for each of the primitives 
          int dice[] = { dicey, dicey, dicex, dicex, diceb, diceb, diceb, diceb 
};
***************
*** 666,687 ****
              float w = wtbl[i];
  
              glBegin(GL_QUAD_STRIP);
!             glSecondaryColor3fEXT(0, 0, 0);
!             glTexCoord2f(tex0.x, tex0.y);
!             vert(coords1, coords2, sides[i][0]);
! 
!             glSecondaryColor3fEXT(1, 1, 1);
!             glTexCoord4f(tex0.x * w, tex0.y * w, 0, w);
!             vert(coords1, coords2, sides[i][3]);
! 
!             glSecondaryColor3fEXT(0, 0, 0);
!             glTexCoord2f(tex1.x, tex1.y);
!             vert(coords1, coords2, sides[i][1]);
! 
!             glSecondaryColor3fEXT(1, 1, 1);
!             glTexCoord4f(tex1.x * w, tex1.y * w, 0, w);
!             vert(coords1, coords2, sides[i][2]);                
!                 
              glEnd();
              GLERR;
  
--- 666,686 ----
              float w = wtbl[i];
  
              glBegin(GL_QUAD_STRIP);
! 
!             for (int d = 0; d <= dice[i]; d++) {
!                 float t = (float)d / dice[i];
!                 ZVec tex = lerp(tex0, tex1, t);
!                 ZPt pt0 = lerp(sides[i][0], sides[i][1], t);
!                 ZPt pt1 = lerp(sides[i][3], sides[i][2], t);
! 
!                 glSecondaryColor3fEXT(0, 0, 0);
!                 glTexCoord2f(tex.x, tex.y);
!                 vert(coords1, coords2, pt0);
! 
!                 glSecondaryColor3fEXT(1, 1, 1);
!                 glTexCoord4f(tex.x * w, tex.y * w, 0, w);
!                 vert(coords1, coords2, pt1);
!             }
              glEnd();
              GLERR;
  
***************
*** 690,708 ****
          glDisable(GL_REGISTER_COMBINERS_NV);
          glDisable(GL_TEXTURE_2D);
  
!         glBegin(GL_POLYGON);
!         
!         vert(coords1, coords2, ZPt(+x1,+y2,0));
!         vert(coords1, coords2, ZPt(+x2,+y1,0));
! 
!         vert(coords1, coords2, ZPt(-x2,+y1,0));
!         vert(coords1, coords2, ZPt(-x1,+y2,0));
  
!         vert(coords1, coords2, ZPt(-x1,-y2,0));
!         vert(coords1, coords2, ZPt(-x2,-y1,0));
! 
!         vert(coords1, coords2, ZPt(+x2,-y1,0));
!         vert(coords1, coords2, ZPt(+x1,-y2,0));
          glEnd();
  
          if (mode) glPopMatrix();
--- 689,707 ----
          glDisable(GL_REGISTER_COMBINERS_NV);
          glDisable(GL_TEXTURE_2D);
  
!         ZPt poly[] = { ZPt(+x1,+y2,0), ZPt(+x2,+y1,0),
!                        ZPt(-x2,+y1,0), ZPt(-x1,+y2,0),
!                        ZPt(-x1,-y2,0), ZPt(-x2,-y1,0),
!                        ZPt(+x2,-y1,0), ZPt(+x1,-y2,0), ZPt(+x1,+y2,0) };
!         int dice[] = { diceb, dicex, diceb, dicey, diceb, dicex, diceb, dicey 
};
  
!         glBegin(GL_POLYGON);
!         for (int i = 0; i < 8; i++) {
!             for (int d = 0; d <= dice[i]; d++) {
!                 float t = (float)d / dice[i];
!                 vert(coords1, coords2, lerp(poly[i], poly[i+1], t));
!             }
!         }
          glEnd();
  
          if (mode) glPopMatrix();




reply via email to

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