gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz ./TODO gfx/demo/texturelab.py gfx/libtextur...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz ./TODO gfx/demo/texturelab.py gfx/libtextur...
Date: Thu, 05 Sep 2002 05:49:54 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/09/05 05:49:53

Modified files:
        .              : TODO 
        gfx/demo       : texturelab.py 
        gfx/libtexture : TubeFrame.texture 

Log message:
        Start looking at tubeframe

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/TODO.diff?tr1=1.78&tr2=1.79&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/texturelab.py.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libtexture/TubeFrame.texture.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: gzz/TODO
diff -c gzz/TODO:1.78 gzz/TODO:1.79
*** gzz/TODO:1.78       Wed Sep  4 09:54:51 2002
--- gzz/TODO    Thu Sep  5 05:49:52 2002
***************
*** 99,104 ****
--- 99,105 ----
        + Fix UML sequence diagram: now you have to put
          seqobjects *after* the sequence...
        + bidirectional jlinks
+       - fix mirror failing test, make more tests and check.
  
  0.8alpha6: Another doc round
      tjl:
Index: gzz/gfx/demo/texturelab.py
diff -c gzz/gfx/demo/texturelab.py:1.8 gzz/gfx/demo/texturelab.py:1.9
*** gzz/gfx/demo/texturelab.py:1.8      Wed Sep  4 14:05:43 2002
--- gzz/gfx/demo/texturelab.py  Thu Sep  5 05:49:52 2002
***************
*** 9,41 ****
      return " ".join([str(el) for el in list])
  
  
! t = [
!  ("tf1", [256, 256, 0, 2], 
! 
  
  class ShaderScene:
      def __init__(self):
-       self.resolution = [256, 256]
-       self.shadername = "filereader"
-       self.shaderparams = {
-           "bulgemagz": 0.5,
-           "bulgemagx": 0,
-           "lfreq": 2,
-           "hfreq": 10,
-           "bias": -.0,
-             "scale": 1,
-             "file": "lava/gfx/c.dat"
-       }
-       self.colors = [ (1, 1, 1), (1, 0, 0), (0, 1, 0), (0, 0, 1)]
-       self.shadercomps = 1
-       self.shaderformat = "LUMINANCE"
-       self.internalformat = "LUMINANCE"
-       self.angle = 0
-       self.sca = 1
        self.shade()
      def key(self, k):
-         if k == "+": self.sca += 1./16
-         if k == "-": self.sca -= 1./16
        if k == "s":
            retexture()
              self.shade()
--- 9,54 ----
      return " ".join([str(el) for el in list])
  
  
! t = {
!  "tfamb": ( 256, 256, 0, 2, "LUMINANCE_ALPHA", "LUMINANCE_ALPHA",
!     "TubeFrame", ["light", "ambient" ]),
!  "tfdiff": ( 256, 256, 0, 2, "LUMINANCE_ALPHA", "LUMINANCE_ALPHA",
!     "TubeFrame", ["light", "diffuse" ]),
!  "tfspec": ( 256, 256, 0, 2, "LUMINANCE_ALPHA", "LUMINANCE_ALPHA",
!     "TubeFrame", ["light", "specular" ]),
! }
! 
! curtex = [
!     "tfamb", "tfdiff", "tfspec"
! ]
! 
! shaded = { }
! 
! def shadedquad(color, tex):
!     return getDList("""
!               Color %(color)s
!               BindTexture TEXTURE_2D %(tex)s
!                 TexParameter TEXTURE_2D TEXTURE_MAG_FILTER LINEAR
!               Enable TEXTURE_2D
!               Begin QUAD_STRIP
!                   TexCoord 1.1 1.1 0
!                   Vertex 1 -1 1
!                   TexCoord 1.1 -0.1 0
!                   Vertex 1 1 1
!                   TexCoord -0.1 1.1 5
!                   Vertex -1 -1 1
!                   TexCoord -0.1 -0.1 5
!                   Vertex -1 1 1
!               End
!           """ % {
!               "tex" : tex.getTexId(),
!               "color" : js(color),
!               })
  
  class ShaderScene:
      def __init__(self):
        self.shade()
      def key(self, k):
        if k == "s":
            retexture()
              self.shade()
***************
*** 43,75 ****
        if k == "c":
            rotate(self.colors)
      def shade(self):
!       params = []
!       for item in self.shaderparams.items():
!           params.append(item[0])
!           params.append(str(item[1]))
!       self.texture = getTexture( self.resolution[0], self.resolution[0], 
self.resolution[0],
!           self.shadercomps, self.shaderformat, self.internalformat, 
!           self.shadername,
!           params)
!       print "SHADER: ",self.texture
      def scene(self, vs):
  
!       putnoc(vs, background((0.5,0.5,0.5)))
  
        putnoc(vs, getDList("""
            PushAttrib POLYGON_BIT ENABLE_BIT
            Disable ALPHA_TEST
            Disable DEPTH_TEST
!           Disable BLEND
            Disable TEXTURE_3D
        """))
  
!       self.angle += 13
  
-       print "Angle: ",self.angle
-       rotate(vs, "rot", 45, 0, 1, 0)
-       #self.sca = 1-self.sca
  
        transaffine(vs, "coor", 100*self.sca, 0, 1, 0, 0, 1)
        putnoc(vs,
            getDListNocoords("""
--- 56,96 ----
        if k == "c":
            rotate(self.colors)
      def shade(self):
!       self.t = []
!       for texname in curtex:
!           texture = GZZGL.createTexture()
!           apply(texture.shade, t[texname])
!           self.t.append(texture)
! 
      def scene(self, vs):
  
!       putnoc(vs, background((1.0,0.5,0.5)))
  
        putnoc(vs, getDList("""
            PushAttrib POLYGON_BIT ENABLE_BIT
            Disable ALPHA_TEST
            Disable DEPTH_TEST
!           Enable BLEND
!           BlendFunc SRC_ALPHA ONE_MINUS_SRC_ALPHA
            Disable TEXTURE_3D
        """))
  
!       print "T: ",self.t
!       s = shadedquad("1 0 0 1", self.t[0]);
!       print s
!       vs.put(s, "0", 10, 0, 0, 500, 500);
!       vs.put(shadedquad("1 0 0 1", self.t[1]),
!           "1", 10, 0, 500, 500,500);
!       vs.put(shadedquad("1 0 0 1", self.t[2]),
!           "2", 10, 500, 000, 500,500);
! 
!       putnoc(vs, getDList("""
!           PopAttrib
!       """))
! 
  
  
+ def d3foo():
        transaffine(vs, "coor", 100*self.sca, 0, 1, 0, 0, 1)
        putnoc(vs,
            getDListNocoords("""
Index: gzz/gfx/libtexture/TubeFrame.texture
diff -c gzz/gfx/libtexture/TubeFrame.texture:1.1 
gzz/gfx/libtexture/TubeFrame.texture:1.2
*** gzz/gfx/libtexture/TubeFrame.texture:1.1    Wed Aug  7 06:24:00 2002
--- gzz/gfx/libtexture/TubeFrame.texture        Thu Sep  5 05:49:53 2002
***************
*** 114,116 ****
--- 114,117 ----
  }
  
  
+ // vim: set syntax=c :




reply via email to

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