gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gfx/libpaper Paper.cxx Paper.hxx papermill....


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz/gfx/libpaper Paper.cxx Paper.hxx papermill....
Date: Sat, 31 Aug 2002 01:26:58 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/08/31 01:26:58

Modified files:
        gfx/libpaper   : Paper.cxx Paper.hxx papermill.py 
Added files:
        gfx/libpaper   : texcoords.py 

Log message:
        Clean up texture coordinate generation

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/texcoords.py?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/Paper.cxx.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/Paper.hxx.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/papermill.py.diff?tr1=1.13&tr2=1.14&r1=text&r2=text

Patches:
Index: gzz/gfx/libpaper/Paper.cxx
diff -c gzz/gfx/libpaper/Paper.cxx:1.2 gzz/gfx/libpaper/Paper.cxx:1.3
*** gzz/gfx/libpaper/Paper.cxx:1.2      Mon Aug 19 10:27:59 2002
--- gzz/gfx/libpaper/Paper.cxx  Sat Aug 31 01:26:58 2002
***************
*** 11,16 ****
--- 11,21 ----
        tvec[1] = tex_mat[5];
        tvec[2] = tex_mat[6];
        tvec[3] = tex_mat[7];
+ 
+       rvec[0] = tex_mat[8];
+       rvec[1] = tex_mat[9];
+       rvec[2] = tex_mat[10];
+       rvec[3] = tex_mat[11];
        }
  
        void TexGen::setUp(LightParam *param) {
***************
*** 28,35 ****
--- 33,43 ----
        glTexGenfv(GL_S, GL_EYE_PLANE, svec);
        glTexGenf(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
        glTexGenfv(GL_T, GL_EYE_PLANE, tvec);
+       glTexGenf(GL_R, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
+       glTexGenfv(GL_R, GL_EYE_PLANE, rvec);
        glEnable(GL_TEXTURE_GEN_S);
        glEnable(GL_TEXTURE_GEN_T);
+       glEnable(GL_TEXTURE_GEN_R);
        glPopMatrix();
        }
  
Index: gzz/gfx/libpaper/Paper.hxx
diff -c gzz/gfx/libpaper/Paper.hxx:1.4 gzz/gfx/libpaper/Paper.hxx:1.5
*** gzz/gfx/libpaper/Paper.hxx:1.4      Wed Aug 21 07:27:10 2002
--- gzz/gfx/libpaper/Paper.hxx  Sat Aug 31 01:26:58 2002
***************
*** 78,85 ****
--- 78,90 ----
      protected:
        float svec[4];
        float tvec[4];
+       float rvec[4];
  
      public:
+       /** Create a new texgen.
+        * @param tex_mat A float vector of 12 elements, components of
+        * s, t and r vectors, respectively.
+        */
        TexGen(const float *tex_mat) ;
        virtual void setUp(LightParam *param) ;
      };
Index: gzz/gfx/libpaper/papermill.py
diff -c gzz/gfx/libpaper/papermill.py:1.13 gzz/gfx/libpaper/papermill.py:1.14
*** gzz/gfx/libpaper/papermill.py:1.13  Fri Aug 23 11:11:09 2002
--- gzz/gfx/libpaper/papermill.py       Sat Aug 31 01:26:58 2002
***************
*** 554,562 ****
--- 554,565 ----
                      
                elif ttyp[i] == "C":
                      data = [ 0, 0, 0, sca2*rnd.nextGaussian(), 
+                              0, 0, 0, sca2*rnd.nextGaussian(),
                               0, 0, 0, sca2*rnd.nextGaussian() ]
                else:
                    assert 0
+               if len(data) < 12:
+                   for i in (0,0,0,1): data.append(i)
                  if emboss and ttyp[i] == "A":
                      if eps > 0:
                          prev = data
***************
*** 573,579 ****
  def invTexMat(mat):
      m = 1.0 / (mat[0] * mat[5] - mat[1] * mat[4])
      return [ m*mat[5], m*-mat[1], mat[2], mat[3],
!              m*-mat[4], m*mat[0], mat[6], mat[7] ]
  
  def getTexMat(rnd):
      #sca1 = 10
--- 576,582 ----
  def invTexMat(mat):
      m = 1.0 / (mat[0] * mat[5] - mat[1] * mat[4])
      return [ m*mat[5], m*-mat[1], mat[2], mat[3],
!              m*-mat[4], m*mat[0], mat[6], mat[7]]
  
  def getTexMat(rnd):
      #sca1 = 10
***************
*** 594,597 ****
      
      return invTexMat([ r0 * math.cos(a0), r1 * math.cos(a1), 0, 
rnd.nextDouble(),
                         r0 * math.sin(a0), r1 * math.sin(a1), 0, 
rnd.nextDouble() ])
!     
--- 597,600 ----
      
      return invTexMat([ r0 * math.cos(a0), r1 * math.cos(a1), 0, 
rnd.nextDouble(),
                         r0 * math.sin(a0), r1 * math.sin(a1), 0, 
rnd.nextDouble() ])
! 




reply via email to

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