/[libvob]/libvob/include/vob/vobs/Irregu.hxx
ViewVC logotype

Diff of /libvob/include/vob/vobs/Irregu.hxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by tjl, Sun Apr 20 10:24:04 2003 UTC revision 1.6 by jvk, Tue Apr 22 10:16:50 2003 UTC
# Line 57  public: Line 57  public:
57                            .25 + .5 * yrelp                            .25 + .5 * yrelp
58                            );                            );
59          coords1.vertex(p);          coords1.vertex(p);
60          DBG(dbg_irregularquad) << "Vert: " << q<<p<<coords1.transform(p) <<"\\n";          DBG(dbg_irregularquad) << "Vert: " << q<<p<<coords1.transform(p) <<"\n";
61      }      }
62    
63    
# Line 112  public: Line 112  public:
112            
113    
114      template<class T> void render(const T &coords1, const T &coords2) const {      template<class T> void render(const T &coords1, const T &coords2) const {
115          DBG(dbg_irregularquad) << "Irregular quad\\n";          DBG(dbg_irregularquad) << "Irregular quad\n";
116    
         glCallList(setup);  
         GLERR;  
   
           
117          // Normalize tearaway part unit vectors in paper coords to get border widths          // Normalize tearaway part unit vectors in paper coords to get border widths
118          // Note: we assume that coords2 is an affine transform so that the border (ripple) width          // Note: we assume that coords2 is an affine transform so that the border (ripple) width
119          //       is translation invariant          //       is translation invariant
# Line 126  public: Line 122  public:
122          ZVec yvec = (coords2.transform(ZPt(0,1,0)) - coords2.transform(ZPt(0,0,0))).normalized();          ZVec yvec = (coords2.transform(ZPt(0,1,0)) - coords2.transform(ZPt(0,0,0))).normalized();
123    
124          //cout << (coords2.transform(ZPt(1,0,0)) - coords2.transform(ZPt(0,0,0)))          //cout << (coords2.transform(ZPt(1,0,0)) - coords2.transform(ZPt(0,0,0)))
125          //     << (coords2.transform(ZPt(0,1,0)) - coords2.transform(ZPt(0,0,0))) << "\\n";          //     << (coords2.transform(ZPt(0,1,0)) - coords2.transform(ZPt(0,0,0))) << "\n";
126                    
127          float bx = border * (cs2inv.transform(ZPt(0,0,0) + xvec) - cs2inv.transform(ZPt(0,0,0))).length();          float bx = border * (cs2inv.transform(ZPt(0,0,0) + xvec) - cs2inv.transform(ZPt(0,0,0))).length();
128          float by = border * (cs2inv.transform(ZPt(0,0,0) + yvec) - cs2inv.transform(ZPt(0,0,0))).length();          float by = border * (cs2inv.transform(ZPt(0,0,0) + yvec) - cs2inv.transform(ZPt(0,0,0))).length();
129    
130          //cout << bx << "," << by << "\\n";          //cout << bx << "," << by << "\n";
131    
132          float x0 = 1;          float x0 = 1;
133          float x1 = 1 - bx;          float x1 = 1 - bx;
# Line 192  public: Line 188  public:
188           */           */
189          float texf = 0.5;          float texf = 0.5;
190    
191          DBG(dbg_irregularquad) << "Dice: " << dicex << " " << dicey << " " << diceb << "\\n";          DBG(dbg_irregularquad) << "Dice: " << dicex << " " << dicey << " " << diceb << "\n";
192    
193            if (diceb <= 0 || dicex <= 0 || dicey <= 0) {
194                DBG(dbg_irregularquad) << "Skipping IrregularQuad because of invalid geometry\n";
195                return;
196            }
197    
198            glCallList(setup);
199            GLERR;
200    
201          for (int pass = 0; pass < ((flags & IRREGU_SHIFTS) ? 4 : 1); pass++) {          for (int pass = 0; pass < ((flags & IRREGU_SHIFTS) ? 4 : 1); pass++) {
202    
# Line 270  public: Line 274  public:
274    
275          glPopAttrib();          glPopAttrib();
276    
277          DBG(dbg_irregularquad) << "IrregularQuad done\\n";          DBG(dbg_irregularquad) << "IrregularQuad done\n";
278      }      }
279  };  };
280    
# Line 452  public: Line 456  public:
456    
457          glPopAttrib();          glPopAttrib();
458          GLERR;          GLERR;
459          DBG(dbg_irregularquad) << "IrregularEdge done\\n";          DBG(dbg_irregularquad) << "IrregularEdge done\n";
460      }      }
461  };  };
462    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

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