gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gfx demo/calendarvobtest.py liblines/Lines....


From: Matti Katila
Subject: [Gzz-commits] gzz/gfx demo/calendarvobtest.py liblines/Lines....
Date: Sat, 02 Nov 2002 19:09:55 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Matti Katila <address@hidden>   02/11/02 19:09:54

Modified files:
        gfx/demo       : calendarvobtest.py 
        gfx/liblines   : Lines.cxx 
        gfx/librenderables: renderables.py 

Log message:
        Enough calendar for this night. Seems to work.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/calendarvobtest.py.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/liblines/Lines.cxx.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.124&tr2=1.125&r1=text&r2=text

Patches:
Index: gzz/gfx/demo/calendarvobtest.py
diff -u gzz/gfx/demo/calendarvobtest.py:1.13 
gzz/gfx/demo/calendarvobtest.py:1.14
--- gzz/gfx/demo/calendarvobtest.py:1.13        Sat Nov  2 15:54:48 2002
+++ gzz/gfx/demo/calendarvobtest.py     Sat Nov  2 19:09:53 2002
@@ -21,32 +21,36 @@
 
         angle = 0
        if self.rotate:
-           angle = 1 * self.rotate
+           angle = 0.81 * self.rotate
 
         print "ROTATE: ", angle
 
+        # Coordinate systems:
         cs_home = vs.coords.affineCoordsys(0,0,
                                            w/2 + self.tx*self.scale,
                                            h/2 + self.ty*self.scale,
                                            w*self.scale, 0,0, h*self.scale)
 
-        home = vs.matcher.add(cs_home, "cs_home")
+        #home = vs.matcher.add(cs_home, "cs_home")
+        cs_rot = vs.coords.rotateXYZ(cs_home, angle, -1, 1, 1)
+        vs.matcher.add(cs_rot, "cs_koti_rot")
+
+        cs_text = vs.coords.affineCoordsys(0, 0, 0, 0,w*self.scale, 0,0, 
h*self.scale)
+        # cs_text_match = vs.matcher.add(cs_text, "cs_text"+str(i))
+        cs_text_rot = vs.coords.rotateXYZ(cs_text, angle, -1, 1, 1)
 
-        cs_rot = vs.coords.rotateXYZ(home, angle, -1, 1, 1)
-
-        rot = vs.matcher.add(cs_rot, "cs_koti_rot")
 
         # these don't efect
-        gzz.vob.vobs.CalendarVob.setStatics(style_date, style_n, 0.05)
+        gzz.vob.vobs.CalendarVob.setStatics(style_date, style_n, 0.04)
 
         # week number width, weekday height, month name height
-        gzz.vob.vobs.CalendarVob.setBounds(0.5, 0.5, 1.0)
+        gzz.vob.vobs.CalendarVob.setBounds(0.37, 0.5, 1.0)
 
         # scales: date, weeknum, weekday, month
-        gzz.vob.vobs.CalendarVob.setScales(1.1, 0.4, 0.24, 1.3)
+        gzz.vob.vobs.CalendarVob.setScales(1.4, 0.5, 0.34, 1.4)
 
         # shift(something(x,y)): date, weeknum, weekday, month
-        gzz.vob.vobs.CalendarVob.setShifting(0.05, 0.85, 0.2, 0.1)
+        gzz.vob.vobs.CalendarVob.setShifting(0.37, 0.85, 0.2, 0.1)
         
        
         # annual calendar
@@ -54,11 +58,8 @@
             cs_cal = vs.coords.affineCoordsys(cs_rot , 0, 0 , i*9,  1.5, 0, 0, 
1.15)
             vs.matcher.add(cs_cal, "cs_cal"+str(i))
 
-            cs_text = vs.coords.affineCoordsys(0, 0, 0, 0,w*self.scale, 0,0, 
h*self.scale)
-
-            vs.matcher.add(cs_text, "cs_text"+str(i))
-
-            vs.map.put(gzz.vob.vobs.CalendarVob(2002, i), cs_cal, cs_text)
+            vs.matcher.add(cs_text_rot, "cs_text_rot"+str(i))
+            vs.map.put(gzz.vob.vobs.CalendarVob(2002, i), cs_cal, cs_text_rot)
 
 
         if 0:
@@ -77,7 +78,7 @@
        cs1 = vs.coords.affineCoordsys(0, 10, 0, 0, tscale, 0, 0, tscale)
         vs.matcher.add(cs1, "1")
         putText(vs, cs1, '  Use keys: +, -, Left, Right, Up, Down,', 
color=(0,0,0), h=4, y = 3)
-        putText(vs, cs1, '       PageUp, and PageDown', color=(0,0,0), h=4, y 
= 6)
+        putText(vs, cs1, '     Z, z, PageUp, and PageDown', color=(0,0,0), 
h=4, y = 6)
 
         
     def key(self, k):
Index: gzz/gfx/liblines/Lines.cxx
diff -u gzz/gfx/liblines/Lines.cxx:1.11 gzz/gfx/liblines/Lines.cxx:1.12
--- gzz/gfx/liblines/Lines.cxx:1.11     Sat Nov  2 15:54:48 2002
+++ gzz/gfx/liblines/Lines.cxx  Sat Nov  2 19:09:54 2002
@@ -58,7 +58,7 @@
            } else {
                switch(size) {
                case 4: line_image[1] = 1;
-                   line_image[2] = 1; break;
+                       line_image[2] = 1; break;
                case 2: line_image[1] = 1; break;
                case 1: line_image[0] = 1; break;
                }
@@ -101,23 +101,31 @@
 
        glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
 
-       float l = linewidth/2;
+       float lp2 = 1 + linewidth/2;
        float texcoord = 0.5;
-       texcoord *=  (l+1)/l;
+       texcoord *=  1/lp2;
+       
+       ZPt l = (a-b).cw90().normalized();
+       l.x *= lp2; l.y *= lp2;
+
+       float t0 = 0.5 - texcoord;
+       float t1 = 0.5 + texcoord;
+
+       if (dbg) cout <<"t1: " << t1 <<" t0 :" << t0 << endl;
 
        glBegin(GL_QUADS);
          
-           glTexCoord2f(0,0);
-           glVertex3f(a.x - 1 -l, a.y - 1 - l, 0);
+           glTexCoord2f(t0, t1);
+           glVertex3f(a.x + l.x, a.y + l.y, 0);
 
-           glTexCoord2f(texcoord,0);
-           glVertex3f(a.x + 1 + l, a.y + 1 + l, 0);
+           glTexCoord2f(t1, t1);
+           glVertex3f(a.x - l.x, a.y - l.y, 0);
 
-           glTexCoord2f(texcoord, texcoord);
-           glVertex3f(b.x + 1 + l, b.y + 1 + l, 0);
+           glTexCoord2f(t1, t0);
+           glVertex3f(b.x - l.x, b.y - l.y, 0);
 
-           glTexCoord2f(0, texcoord);
-           glVertex3f(b.x - 1-l, b.y - 1 - l, 0);
+           glTexCoord2f(t0, t0);
+           glVertex3f(b.x + l.x, b.y + l.y, 0);
 
        glEnd();
 
Index: gzz/gfx/librenderables/renderables.py
diff -u gzz/gfx/librenderables/renderables.py:1.124 
gzz/gfx/librenderables/renderables.py:1.125
--- gzz/gfx/librenderables/renderables.py:1.124 Sat Nov  2 15:32:48 2002
+++ gzz/gfx/librenderables/renderables.py       Sat Nov  2 19:09:54 2002
@@ -1290,11 +1290,11 @@
                 float frow = weekday_h + month_name_h;
 
                 if (i<10) {
-                    fcol += column + 0.20;
-                    frow += row - 0.15;
+                    fcol += column + 0.5 + 0.20;
+                    frow += row - 0.5 - 0.15;
                 } else {
-                    fcol += column;
-                    frow += row - 0.15;
+                    fcol += column + 0.5;
+                    frow += row - 0.5 - 0.15;
                 }
 
                 glColor3f(1.0, 1.0, 1.0);
@@ -1304,7 +1304,7 @@
                 );
                 
                Text::renderIter(*r_date, buffer, buffer+strlen(buffer), 
-                     shifts[0], -shifts[0],
+                     -shifts[0], shifts[0],
                      v_date
                );
 
@@ -1313,7 +1313,7 @@
                 else  glColor3f(0.0, 0.0, 0.0);
 
                Text::renderIter(*r_date, buffer, buffer+strlen(buffer),
-                    shifts[0] + 0.03, -shifts[0] + 0.03,
+                    -shifts[0] + 0.03, shifts[0] + 0.03,
                     v_date
                );
 




reply via email to

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