gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] libvob include/vob/vobs/Paper.hxx vob/demo/pape...


From: Janne V. Kujala
Subject: [Gzz-commits] libvob include/vob/vobs/Paper.hxx vob/demo/pape...
Date: Sun, 13 Jul 2003 15:04:27 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Branch:         
Changes by:     Janne V. Kujala <address@hidden>        03/07/13 15:04:26

Modified files:
        include/vob/vobs: Paper.hxx 
        vob/demo/paper : combinerutil.py 

Log message:
        port basispaperquad from gzz

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Paper.hxx.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/demo/paper/combinerutil.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: libvob/include/vob/vobs/Paper.hxx
diff -u libvob/include/vob/vobs/Paper.hxx:1.15 
libvob/include/vob/vobs/Paper.hxx:1.16
--- libvob/include/vob/vobs/Paper.hxx:1.15      Mon Jun 23 10:53:19 2003
+++ libvob/include/vob/vobs/Paper.hxx   Sun Jul 13 15:04:26 2003
@@ -757,6 +757,105 @@
 VOB_DEFINED(EasyPaperQuad);
 
 
+
+
+class BasisPaperQuad {
+public:
+    enum { NTrans = 2 };
+    
+    ::Vob::Paper::Paper *paper;
+    float x0_0, y0_0, x0_1, y0_1;
+    float x1_0, y1_0, x1_1, y1_1;
+    DisplayListID tex0, tex1, isect;
+    
+    template<class F> void params(F &f) {
+       f(paper, x0_0, y0_0, x0_1, y0_1, x1_0, y1_0, x1_1, y1_1, tex0, tex1, 
isect);
+    }
+
+    template<class T> void render(const T &coords1, const T &coords2) const {
+           DBG(dbg) << "Paper\\n";
+           GLERR;
+
+           const Transform &cs1inv = coords1.getInverse();
+           const Transform &cs2inv = coords2.getInverse();
+
+           for(Paper::Paper::iterator it = paper->begin(); it != paper->end(); 
++it) {
+               if (dbg) cout << "Pass\\n";
+
+               GLERR;
+
+                Pt p0[] = { Pt(x0_0,y0_0), Pt(x0_0,y0_1), Pt(x0_1,y0_1), 
Pt(x0_1,y0_0) };
+                Pt p1[] = { Pt(x1_0,y1_0), Pt(x1_0,y1_1), Pt(x1_1,y1_1), 
Pt(x1_1,y1_0) };
+                ZPt q;
+
+                // Draw the first texture
+                (*it).setupcode();
+                glEnable(GL_DEPTH_TEST);
+                glDepthFunc(GL_LESS);
+                glCallList(tex0);
+                GLERR;
+               glBegin(GL_QUADS);
+                for (int i = 0; i < 4; i++) {
+                    ZPt v = coords1.transform(p0[i]);
+                    glMultiTexCoord2fARB(0, p0[i].x, p0[i].y);
+                    q = cs2inv.transform(v);
+                    glMultiTexCoord2fARB(1, q.x, q.y);
+                    coords1.vertex(p0[i]);
+                }
+                glEnd();
+               GLERR;
+               (*it).teardowncode();
+               GLERR;
+
+                // Draw the intersection
+                (*it).setupcode();
+                glEnable(GL_DEPTH_TEST);
+                glDepthFunc(GL_EQUAL);
+                glCallList(isect);
+               GLERR;
+               glBegin(GL_QUADS);
+                for (int i = 0; i < 4; i++) {
+                    ZPt v = coords2.transform(p1[i]);
+                    glMultiTexCoord2fARB(1, p1[i].x, p1[i].y);
+                    q = cs1inv.transform(v);
+                    glMultiTexCoord2fARB(0, q.x, q.y);
+                    coords2.vertex(p1[i]);
+                }
+                glEnd();
+               GLERR;
+               (*it).teardowncode();
+               GLERR;
+
+                // Draw the second texture
+                (*it).setupcode();
+                glEnable(GL_DEPTH_TEST);
+                glDepthFunc(GL_LESS);
+                glCallList(tex1);
+               GLERR;
+               glBegin(GL_QUADS);
+                for (int i = 0; i < 4; i++) {
+                    ZPt v = coords2.transform(p1[i]);
+                    glMultiTexCoord2fARB(1, p1[i].x, p1[i].y);
+                    q = cs1inv.transform(v);
+                    glMultiTexCoord2fARB(0, q.x, q.y);
+                    coords2.vertex(p1[i]);
+                }
+                glEnd();
+               GLERR;
+               (*it).teardowncode();
+               GLERR;
+
+
+
+
+           }
+
+           GLERR;
+    }
+};
+
+VOB_DEFINED(BasisPaperQuad);
+
 }
 }
 
Index: libvob/vob/demo/paper/combinerutil.py
diff -u libvob/vob/demo/paper/combinerutil.py:1.2 
libvob/vob/demo/paper/combinerutil.py:1.3
--- libvob/vob/demo/paper/combinerutil.py:1.2   Mon Apr 28 03:06:24 2003
+++ libvob/vob/demo/paper/combinerutil.py       Sun Jul 13 15:04:26 2003
@@ -186,9 +186,9 @@
 
     return GLRen.createBasisPaperQuad(pap, 0, 0, x0, y0,
                                0, 0, x1, y1,
-                                      constcode + parsedTexcodes[tex0comb],
-                                      constcode + parsedTexcodes[tex1comb],
-                                      constcode + parsedTexcodes[isectcomb])
+                                      GL.createDisplayList(constcode + 
parsedTexcodes[tex0comb]),
+                                      GL.createDisplayList(constcode + 
parsedTexcodes[tex1comb]),
+                                      GL.createDisplayList(constcode + 
parsedTexcodes[isectcomb]))
 
 rng = java.util.Random()
 




reply via email to

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