gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz Documentation/Manuscripts/Paper/paper.tex g...


From: Janne V. Kujala
Subject: [Gzz-commits] gzz Documentation/Manuscripts/Paper/paper.tex g...
Date: Sat, 30 Nov 2002 10:57:27 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Janne V. Kujala <address@hidden>        02/11/30 10:57:27

Modified files:
        Documentation/Manuscripts/Paper: paper.tex 
        gfx/demo       : irregu4.py 

Log message:
        Add motion fig code for 2D offset / 1D offset / 1D displacement; 
there's still a problem with 2D offset edges, working on it

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/Documentation/Manuscripts/Paper/paper.tex.diff?tr1=1.104&tr2=1.105&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/irregu4.py.diff?tr1=1.27&tr2=1.28&r1=text&r2=text

Patches:
Index: gzz/Documentation/Manuscripts/Paper/paper.tex
diff -u gzz/Documentation/Manuscripts/Paper/paper.tex:1.104 
gzz/Documentation/Manuscripts/Paper/paper.tex:1.105
--- gzz/Documentation/Manuscripts/Paper/paper.tex:1.104 Sat Nov 30 05:56:06 2002
+++ gzz/Documentation/Manuscripts/Paper/paper.tex       Sat Nov 30 10:57:27 2002
@@ -95,7 +95,7 @@
 are very similar: ``You are in a maze of twisty 
 little passages, all alike.'' in the classic computer game Zork.
 
-In this article, we apply backgrounds textures
+In this article, we apply background textures
 procedurally generated from
 data identity as a navigation aid in focus+context views.
 
Index: gzz/gfx/demo/irregu4.py
diff -u gzz/gfx/demo/irregu4.py:1.27 gzz/gfx/demo/irregu4.py:1.28
--- gzz/gfx/demo/irregu4.py:1.27        Sat Nov 30 09:29:29 2002
+++ gzz/gfx/demo/irregu4.py     Sat Nov 30 10:57:27 2002
@@ -94,6 +94,35 @@
             TexParameter TEXTURE_2D TEXTURE_MAG_FILTER NEAREST
             BindTexture TEXTURE_2D 0
             """ % texBOX.getTexId())
+
+        global offset_code
+        offset_code = parseCombiner("""
+            PushAttrib ENABLE_BIT TEXTURE_BIT CURRENT_BIT
+            BindTexture TEXTURE_2D %s
+            TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
+            TexParameter TEXTURE_2D TEXTURE_MAG_FILTER LINEAR
+            Enable TEXTURE_2D
+
+            Enable TEXTURE_SHADER_NV
+            TexEnv TEXTURE_SHADER_NV SHADER_OPERATION_NV TEXTURE_2D
+        
+            ActiveTexture TEXTURE1
+            TexEnv TEXTURE_SHADER_NV SHADER_OPERATION_NV %s
+            TexEnv TEXTURE_SHADER_NV PREVIOUS_TEXTURE_INPUT_NV TEXTURE0
+
+            BindTexture TEXTURE_2D %s
+            Enable TEXTURE_2D
+
+            ActiveTexture TEXTURE0
+
+            Enable ALPHA_TEST
+            AlphaFunc GEQUAL 1.0
+
+            Enable REGISTER_COMBINERS_NV
+            color = 0
+            alpha = TEX1.alpha
+        """ % (texHILO.getTexId(), offsetprog, texBOX.getTexId()))
+
     
 inittex()
 
@@ -472,33 +501,6 @@
                 outer_code, 1.0)
 
         if self.flags >> 9 & 1:
-            offset_code = """
-            PushAttrib ENABLE_BIT TEXTURE_BIT CURRENT_BIT
-            BindTexture TEXTURE_2D %s
-            TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
-            TexParameter TEXTURE_2D TEXTURE_MAG_FILTER LINEAR
-            Enable TEXTURE_2D
-
-            Enable TEXTURE_SHADER_NV
-            TexEnv TEXTURE_SHADER_NV SHADER_OPERATION_NV TEXTURE_2D
-        
-            ActiveTexture TEXTURE1
-            TexEnv TEXTURE_SHADER_NV SHADER_OPERATION_NV %s
-            TexEnv TEXTURE_SHADER_NV PREVIOUS_TEXTURE_INPUT_NV TEXTURE0
-
-            BindTexture TEXTURE_2D %s
-            Enable TEXTURE_2D
-
-            ActiveTexture TEXTURE0
-
-            Enable ALPHA_TEST
-            AlphaFunc GEQUAL 1.0
-            """ % (texHILO.getTexId(), offsetprog, texBOX.getTexId())
-
-            offset_code += parseCombiner("color = 0; alpha = TEX1.alpha;")
-            offset_code += "Enable REGISTER_COMBINERS_NV\n";
-
-            
             self.inner = GLRen.createIrregularEdge(shape,
                 texscale, linewidth, refsize, scale_pow,
                 border0, border1, 1.0,
@@ -651,12 +653,19 @@
 
 
 class StillMotionScene:
-    def __init__(self):
+    def __init__(self, type = 0, flag = 0):
         self.scale = 700
         self.x0, self.y0 = -.35, -.65
         self.x1, self.y1 = .35, .65
         self.xs, self.ys = .6,.4
         self.a1 = 0
+        self.flag = flag
+
+        if flag == 1:
+            self.x0, self.y0 = -.35, -.65
+            self.x1, self.y1 = .35, .65
+            self.xs, self.ys = .6,.4
+            
 
         stdcode = """
         PushAttrib ENABLE_BIT TEXTURE_BIT CURRENT_BIT
@@ -680,6 +689,9 @@
         border1 = .5 * ripple_scale * texscale 
         texslicing = 0.0
 
+        if type == 1:
+            texslicing = 1
+            
         self.inner =  GLRen.createIrregularEdge(
             shape, texscale, linewidth, refsize, scale_pow,
             border0, border1, texslicing,
@@ -697,7 +709,32 @@
             """
             PushAttrib
             Disable TEXTURE_2D
+            Disable ALPHA_TEST
             """, 1.0)
+
+        if type == 2:
+            self.inner = GLRen.createIrregularEdge(shape,
+                texscale, linewidth, refsize, scale_pow,
+                border0, border1, 1.0,
+                "", "", 0, 0,
+                65536,
+                offset_code, 1.0)
+            self.outer = GLRen.createIrregularEdge(shape,
+                texscale, linewidth, refsize, scale_pow,
+                border0, border1, 1.0,
+                "", "", 0, 0,
+                SHIFTS + 65536,
+                offset_code, 1.0)
+            self.envelope = GLRen.createIrregularEdge(7,
+                texscale, linewidth, refsize, scale_pow,
+                border0, border1, 1.0,
+                "", "", 0, 0,
+                SLICE_2D + INSIDE,
+                """
+                PushAttrib
+                Disable TEXTURE_2D
+                """, 1.0)
+
         
         self.canvas = getDList("""
         Enable BLEND
@@ -752,6 +789,26 @@
         vs.map.put(Depth.mask1)
         vs.map.put(Depth.test1)
 
+    def putedge2(self, vs, cs1, cs2, alpha):
+        vs.map.put(Depth.mask0)
+        vs.map.put(Stencil.init)
+        vs.map.put(self.outer, cs1, cs2)
+        vs.map.put(Stencil.clear)
+        vs.map.put(self.inner, cs1, cs2)
+
+        vs.map.put(Stencil.use_clear)
+        vs.map.put(Depth.mask1)
+
+        putnoc(vs, getDListNocoords("""
+        Enable BLEND
+        BlendFunc SRC_ALPHA ONE_MINUS_SRC_ALPHA
+        Color 0 0 0 %s
+        """ % alpha))
+        vs.map.put(self.envelope, cs1, cs2)
+
+        vs.map.put(Stencil.teardown)
+
+
     def scene(self, vs):
         putnoc(vs, background((1.0,1.0,1.0)))
     
@@ -773,7 +830,11 @@
 
             vs.matcher.add(cs2, "2." + str(i))
 
-            self.putedge(vs, cs1, cs2, (.2, .3, .6, 1)[i])
+            alpha = (.2, .3, .6, 1)[i]
+            if self.flag:
+                self.putedge2(vs, cs1, cs2, alpha)
+            else:
+                self.putedge(vs, cs1, cs2, alpha)
 
 
 def r(sc, filename):
@@ -784,12 +845,23 @@
 
 def makeScreenshots():
     w.setLocation(0,0,1024,768)
-    ps = StillMotionScene()
+
+
+    ps = StillMotionScene(type = 0)
     r(ps, "shots/motion.png")
 
+    ps = StillMotionScene(type = 0, flag = 1)
+    r(ps, "shots/motion0.png")
+    ps = StillMotionScene(type = 1, flag = 1)
+    r(ps, "shots/motion1.png")
+
+    if globals().has_key("texHILO"):
+        # There still a problem with this
+        ps = StillMotionScene(type = 2, flag = 2)
+        r(ps, "shots/motion2.png")
 
 currentScene = IrreguScene()
 
-#currentScene = StillMotionScene()
+#currentScene = StillMotionScene(type = 1, flag = 1)
 
 #GL.call("PolygonMode FRONT_AND_BACK FILL")




reply via email to

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