[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gfx/demo irregu4.py
From: |
Janne V. Kujala |
Subject: |
[Gzz-commits] gzz/gfx/demo irregu4.py |
Date: |
Tue, 03 Dec 2002 06:41:03 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Janne V. Kujala <address@hidden> 02/12/03 06:41:03
Modified files:
gfx/demo : irregu4.py
Log message:
animcode
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/irregu4.py.diff?tr1=1.40&tr2=1.41&r1=text&r2=text
Patches:
Index: gzz/gfx/demo/irregu4.py
diff -u gzz/gfx/demo/irregu4.py:1.40 gzz/gfx/demo/irregu4.py:1.41
--- gzz/gfx/demo/irregu4.py:1.40 Sun Dec 1 18:55:03 2002
+++ gzz/gfx/demo/irregu4.py Tue Dec 3 06:41:03 2002
@@ -1,6 +1,6 @@
from gfx.libutil.nvcode import combinercode, parseCombiner
from gfx.libpaper.texcache import getCachedTexture
-from math import sin,cos
+from math import sin,cos,pi
from gfx.libutil import saveanim
@@ -280,6 +280,7 @@
self.shape = 0
self.texslicing = 0
self.flags = 127
+ self.texscale = 1
self.initcode()
@@ -337,7 +338,7 @@
"color" : "0 0 0 0" }
shape = self.shape
- texscale = 1
+ texscale = self.texscale
linewidth = 2
refsize = 128
scale_pow = .5
@@ -476,7 +477,7 @@
0, 0,
slice + Y_COLOR + (self.flags >> 4 & 1) * INSIDE, code, 1.0)
- if GL.hasExtension("GL_NV_register_combiners") and 1:
+ if GL.hasExtension("GL_NV_register_combiners") and 0:
self.outer = GLRen.createIrregularEdge(shape,
texscale, linewidth, refsize, scale_pow,
border0, border1, texslicing,
@@ -953,7 +954,8 @@
self.scale * 1)
vs.matcher.add(cs1, "1")
- for i in range(0,5):
+ n = 9
+ for i in range(0,n):
cs2 = vs.coords.affineCoordsys(
0, 0, self.x1 + .02 * i, self.y1,
@@ -962,7 +964,7 @@
vs.matcher.add(cs2, "2." + str(i))
- alpha = (.2, .4, .6, .8, 1)[i]
+ alpha = .3 + .7 * i / (n - 1.0)
if self.flag:
self.putedge2(vs, cs1, cs2, alpha)
else:
@@ -973,7 +975,7 @@
vs = w.createVobScene()
sc.scene(vs)
w.renderStill(vs, 0)
- saveanim.saveframe(filename, w)
+ #saveanim.saveframe(filename, w)
def makeScreenshots():
@@ -987,7 +989,7 @@
# other parameters are hardcoded
# with if's in StillMotionScene class
- if 1:
+ if 0:
w.setLocation(0,0,1024,768)
## pre-computed angles
#ps = StillMotionScene(type = "0b", flag = 1)
@@ -995,7 +997,7 @@
#ps = StillMotionScene(type = 0)
#r(ps, "shots/motion.png")
- ps = StillMotionScene(type = 1)
+ ps = StillMotionScene(type = 1, flag = 1)
r(ps, "shots/motion.png")
#ps = StillMotionScene(type = 0, flag = 1)
@@ -1031,6 +1033,51 @@
r(ps, "shots/shape2D.png")
ps = ShapeScene(type = 2, outer = 0, border = 2)
r(ps, "shots/shape2Dorig.png")
+
+
+ if 1:
+ frame = 0
+ ps = IrreguScene()
+ w.setLocation(0,0,1024,768)
+
+ global ripple_scale
+ ripple_scale = .5
+
+ ps.texscale = 1.2
+ ps.xs = 1.3
+ ps.ys = 1.3
+ ps.shape = 8
+ ps.texslicing = 1
+ ps.initcode()
+
+
+ N = 600
+ for i in range(0,N):
+
+ a = i / float(N) * 2 * pi
+
+ #ps.x0 = cos(a)
+ #ps.y0 = sin(a)
+ ps.x1 = -cos(a)
+ ps.y1 = -sin(a)
+
+ if i == N:
+ ps.shape = 9
+ ripple_scale = .3
+ ps.texslicing = 0
+ ps.initcode()
+
+ #global paperquad
+ #seed = 201
+ #pap = ThePaperMill().getPaper(seed)
+ #paperquad = GLRen.createPaperQuad(pap, -4, -4, 4, 4, 0)
+
+
+ r(ps, "tmpfilm/irregu%03i.jpg" % frame); frame += 1;
+
+ #saveanim.encodefilm("tmpfilm/irregu\\*.jpg", "irregufilm.avi")
+
+
currentScene = IrreguScene()