[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: |
Sat, 30 Nov 2002 16:42:58 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Janne V. Kujala <address@hidden> 02/11/30 16:42:58
Modified files:
gfx/demo : irregu4.py
Log message:
Start shape scene
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/irregu4.py.diff?tr1=1.33&tr2=1.34&r1=text&r2=text
Patches:
Index: gzz/gfx/demo/irregu4.py
diff -u gzz/gfx/demo/irregu4.py:1.33 gzz/gfx/demo/irregu4.py:1.34
--- gzz/gfx/demo/irregu4.py:1.33 Sat Nov 30 14:40:42 2002
+++ gzz/gfx/demo/irregu4.py Sat Nov 30 16:42:58 2002
@@ -51,6 +51,22 @@
]],
shade_all_levels = 1)
+ global stdcode
+ stdcode = """
+ 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
+ TexEnv TEXTURE_ENV TEXTURE_ENV_MODE ADD
+ Enable ALPHA_TEST
+ AlphaFunc GEQUAL 1.0
+ #MatrixMode TEXTURE
+ #LoadMatrix 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
+ #MatrixMode MODELVIEW
+ """ % texINTENSITY.getTexId()
+
+
if GL.hasExtension("GL_NV_register_combiners"):
texRGBA = getCachedTexture(
[128, 128, 0, 4, "RGBA", "RGBA", "irregu",
@@ -329,26 +345,15 @@
border1 = .5 * ripple_scale * texscale
texslicing = self.texslicing
- stdcode = """
- 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
- TexEnv TEXTURE_ENV TEXTURE_ENV_MODE ADD
- Enable ALPHA_TEST
- AlphaFunc GEQUAL 1.0
- #MatrixMode TEXTURE
- #LoadMatrix 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
- #MatrixMode MODELVIEW
- """ % texINTENSITY.getTexId()
+
+ code = stdcode
c1 = ""
slice = SLICE_1D + (1 - (self.flags >> 6 & 1)) * SLICE_2D;
if slice & SLICE_2D:
c1 = "1 1 1 0 0 0 0 0"
slice += Y_SECCOLOR
- stdcode += combinercode("""
+ code += combinercode("""
SecondaryColorEXT .5 .5 .5
ActiveTexture TEXTURE1
@@ -400,23 +405,11 @@
"0 0 0 1 0 0 0 0", c1,
0, 0,
slice + Y_COLOR + SHIFTS + outerflags,
- stdcode + """
+ code + """
BlendFunc ZERO ZERO
Enable BLEND
""", 1.0)
- self.clear = GLRen.createIrregularEdge(shape,
- texscale, linewidth, refsize, scale_pow,
- border0, border1, texslicing,
- "", "",
- 0, 0,
- SLICE_2D + (self.flags >> 4 & 1) * INSIDE, """
- PushAttrib ENABLE_BIT
- Disable TEXTURE_2D
- Disable ALPHA_TEST
- Color 0 0 0
- """, 1.0)
-
self.envelope = GLRen.createIrregularEdge(shape,
texscale, linewidth, refsize, scale_pow,
border0, border1, texslicing,
@@ -448,7 +441,7 @@
border0, border1, texslicing,
"0 0 0 1 0 0 0 0", c1,
0, 0,
- slice + Y_COLOR + (self.flags >> 4 & 1) * INSIDE, stdcode +
+ slice + Y_COLOR + (self.flags >> 4 & 1) * INSIDE, code +
combinercode("""
Enable REGISTER_COMBINERS_NV
CombinerParameterNV NUM_GENERAL_COMBINERS_NV 1
@@ -472,16 +465,16 @@
"""), 1.0)
if (self.flags & 1) == 0:
- stdcode += "Disable TEXTURE_2D\n"
+ code += "Disable TEXTURE_2D\n"
if (self.flags & 4) == 0:
- stdcode += "Disable ALPHA_TEST\n"
+ code += "Disable ALPHA_TEST\n"
self.inner = GLRen.createIrregularEdge(shape,
texscale, linewidth, refsize, scale_pow,
border0, border1, texslicing,
("0 0 0 0 0 0 0 0", "1 1 1 1 0 0 0 0")[self.flags >> 1 & 1], c1,
0, 0,
- slice + Y_COLOR + (self.flags >> 4 & 1) * INSIDE, stdcode, 1.0)
+ slice + Y_COLOR + (self.flags >> 4 & 1) * INSIDE, code, 1.0)
if GL.hasExtension("GL_NV_register_combiners") and 1:
self.outer = GLRen.createIrregularEdge(shape,
@@ -552,7 +545,6 @@
cspap = vs.coords.affineCoordsys(0, 0, 0, 0, 1, 0, 0, 1)
vs.matcher.add(cspap, "pap")
- #vs.map.put(self.clear)
if self.flags & 128:
vs.map.put(self.shadow, cs1shadow, cs2)
@@ -656,6 +648,48 @@
pass
+class ShapeScene:
+ def scene(self, vs):
+ putnoc(vs, background((1.0,1.0,1.0)))
+
+ xs = 256
+ ys = 256
+
+ w = 2
+ h = 2
+ for y in range(0,h):
+ for x in range(0,w):
+
+
+ shape = 10
+ texscale = 1
+ linewidth = 4
+ refsize = 128
+ scale_pow = 0
+ border0 = -.5 * ripple_scale * texscale
+ border1 = .5 * ripple_scale * texscale
+ texslicing = 0.0
+
+ edge = GLRen.createIrregularEdge(
+ shape, texscale, linewidth, refsize, scale_pow,
+ border0, border1, texslicing,
+ "0 0 0 1 0 0 0 0", "", 0, 0, SLICE_1D + Y_COLOR, # +
INSIDE,
+ stdcode, 1.0)
+
+ cs1 = vs.coords.affineCoordsys(0, 10,
+ (x+1) * xs, (y+1) * ys,
+ xs/3., 0, 0, ys/3.,
+ )
+
+ vs.matcher.add(cs1, "1,%s,%s" % (x,y))
+
+ cs2 = vs.coords.affineCoordsys(0, 0, 0, 0, 1, 0, 0, 1);
+ vs.matcher.add(cs1, "2")
+
+ vs.map.put(edge, cs1, cs2)
+
+
+
class StillMotionScene:
def __init__(self, type = 0, flag = 0):
self.scale = 700
@@ -669,20 +703,6 @@
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
- BindTexture TEXTURE_2D %s
- TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
- TexParameter TEXTURE_2D TEXTURE_MAG_FILTER LINEAR
- Enable TEXTURE_2D
- TexEnv TEXTURE_ENV TEXTURE_ENV_MODE ADD
- TexEnv TEXTURE_FILTER_CONTROL_EXT TEXTURE_LOD_BIAS_EXT 0
- Enable ALPHA_TEST
- AlphaFunc GEQUAL 1.0
- """ % texINTENSITY.getTexId()
-
shape = 10
if type == 1: shape = 7
@@ -896,5 +916,7 @@
currentScene = IrreguScene()
#currentScene = StillMotionScene(type = 1, flag = 1)
+
+#currentScene = ShapeScene()
#GL.call("PolygonMode FRONT_AND_BACK FILL")
- [Gzz-commits] gzz/gfx/demo irregu4.py, (continued)
- [Gzz-commits] gzz/gfx/demo irregu4.py, Janne V. Kujala, 2002/11/20
- [Gzz-commits] gzz/gfx/demo irregu4.py, Janne V. Kujala, 2002/11/20
- [Gzz-commits] gzz/gfx/demo irregu4.py, Janne V. Kujala, 2002/11/21
- [Gzz-commits] gzz/gfx/demo irregu4.py, Janne V. Kujala, 2002/11/25
- [Gzz-commits] gzz/gfx/demo irregu4.py, Janne V. Kujala, 2002/11/30
- [Gzz-commits] gzz/gfx/demo irregu4.py, Janne V. Kujala, 2002/11/30
- [Gzz-commits] gzz/gfx/demo irregu4.py, Janne V. Kujala, 2002/11/30
- [Gzz-commits] gzz/gfx/demo irregu4.py, Janne V. Kujala, 2002/11/30
- [Gzz-commits] gzz/gfx/demo irregu4.py, Janne V. Kujala, 2002/11/30
- [Gzz-commits] gzz/gfx/demo irregu4.py,
Janne V. Kujala <=