gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gfx anim/test.py demo/fillet/ambiguity.py d...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz/gfx anim/test.py demo/fillet/ambiguity.py d...
Date: Wed, 11 Dec 2002 00:48:31 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/12/11 00:48:30

Modified files:
        gfx/anim       : test.py 
        gfx/demo/fillet: ambiguity.py util.py 
        gfx/util       : anim.py 

Log message:
        Fix animation generation

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/anim/test.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/fillet/ambiguity.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/fillet/util.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/util/anim.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gzz/gfx/anim/test.py
diff -u gzz/gfx/anim/test.py:1.1 gzz/gfx/anim/test.py:1.2
--- gzz/gfx/anim/test.py:1.1    Tue Dec 10 09:47:45 2002
+++ gzz/gfx/anim/test.py        Wed Dec 11 00:48:30 2002
@@ -17,4 +17,6 @@
 
 film.putStill(.05, vs(10,10))
 film.animateLinearlyTo(1, vs(100,50))
+film.animateLinearlyTo(.5, vs(50,200))
+film.animateLinearlyTo(1.5, vs(10,10))
 
Index: gzz/gfx/demo/fillet/ambiguity.py
diff -u gzz/gfx/demo/fillet/ambiguity.py:1.1 
gzz/gfx/demo/fillet/ambiguity.py:1.2
--- gzz/gfx/demo/fillet/ambiguity.py:1.1        Thu Dec  5 12:33:52 2002
+++ gzz/gfx/demo/fillet/ambiguity.py    Wed Dec 11 00:48:30 2002
@@ -1,5 +1,7 @@
 #(c): Tuomas J. Lukka
 
+from __future__ import nested_scopes
+
 from util import *
 
 class Scene(AlphaCells):
@@ -24,11 +26,11 @@
            gzz.client.AbstractUpdateManager.setNoAnimation()
     def putcells(self, vs, dx):
        d = vs.getSize()
-       w = 140
-       h = 140
+       w = d.width / 20
+       h = w
        if self.shift:
            def yshift(y):
-               if y == 2: return 150
+               if y == 2: return d.width / 6
                return 0
        else: yshift = lambda y : 0
        dy = 1.5
@@ -38,7 +40,7 @@
            for y in (2-dy,2,2+dy)]
        cs = []
        for ctr in ctrs:
-           coordsys = vs.coords.ortho(0, 20, ctr[0], ctr[1], w/2, h/2)
+           coordsys = vs.coords.ortho(0, 20, ctr[0], ctr[1], w, h)
            vs.matcher.add(coordsys, str(dx)+str(ctr[1]))
            cs.append((coordsys, ctr))
        for c in cs:
@@ -66,18 +68,19 @@
 
     def scene(self, vs):
        d = vs.getSize()
+       linew = d.width / 130
        putnoc(vs, background(self.bgcolor))
 
        putnoc(vs, getDList("""
            Enable ALPHA_TEST
-           LineWidth 10
+           LineWidth %(linew)s
            AlphaFunc GEQUAL 0.2
            Enable DEPTH_TEST
            DepthFunc LEQUAL
            Disable BLEND
            Enable TEXTURE_2D
            Color 1 1 1
-       """))
+       """ % locals() ))
 
        cs1 = self.putcells(vs, -1)
        cs2 = self.putcells(vs, 1)
Index: gzz/gfx/demo/fillet/util.py
diff -u gzz/gfx/demo/fillet/util.py:1.1 gzz/gfx/demo/fillet/util.py:1.2
--- gzz/gfx/demo/fillet/util.py:1.1     Thu Dec  5 12:33:52 2002
+++ gzz/gfx/demo/fillet/util.py Wed Dec 11 00:48:30 2002
@@ -1,5 +1,11 @@
 #(c): Tuomas J. Lukka
 
+# Kluge: a directive to the gldemo.py code; this module should
+# not be deleted but simply reloaded with "r".
+__do_not_delete__ = 1
+# Side effect: any modules imported from this module will not get
+# automatically reloaded.
+
 from gfx.util.misc import *
 def texturedquad(texrect, ccoord, eps):
     tex = texrect.getTexId()
Index: gzz/gfx/util/anim.py
diff -u gzz/gfx/util/anim.py:1.2 gzz/gfx/util/anim.py:1.3
--- gzz/gfx/util/anim.py:1.2    Tue Dec 10 07:45:52 2002
+++ gzz/gfx/util/anim.py        Wed Dec 11 00:48:30 2002
@@ -75,6 +75,7 @@
        self.frames.append( (
            nframes, lambda fract, rsurf: rsurf.renderAnim(vs0, vs, fract, 0, 1)
        ))
+       self.prevvs = vs
 
 def loadAnim():
     if 1:
@@ -103,6 +104,9 @@
            frameno += 1
        AbstractUpdateManager.setNoAnimation()
        AbstractUpdateManager.chg()
+
+
+
 class Show(AbstractShower):
     def generate(self):
        film.renderFrame(rs, frameno)
@@ -113,7 +117,10 @@
        print "2"
        vs = w.createVobScene()
        vs.map.put(misc.background((0, 0, 0.2)))
-       cs = vs.translateCS(0, "tr", 300, 300) # 0, animSize[1]-1)
+       vs.map.put(misc.getDListNocoords("""
+           Disable TEXTURE_2D
+       """))
+       cs = vs.translateCS(0, "tr", 0, animSize[1]+1)
        vs.map.put(
            misc.getDListNocoords("""
                Color 1 1 1 1



reply via email to

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