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


From: Asko Soukka
Subject: [Gzz-commits] gzz/gfx/libpaper Paper.cxx Paper.hxx
Date: Mon, 30 Sep 2002 02:44:24 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Asko Soukka <address@hidden>    02/09/30 02:44:22

Modified files:
        gfx/libpaper   : Paper.cxx Paper.hxx 

Log message:
        fixing some own misunderstandings :)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/Paper.cxx.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/Paper.hxx.diff?tr1=1.12&tr2=1.13&r1=text&r2=text

Patches:
Index: gzz/gfx/libpaper/Paper.cxx
diff -c gzz/gfx/libpaper/Paper.cxx:1.13 gzz/gfx/libpaper/Paper.cxx:1.14
*** gzz/gfx/libpaper/Paper.cxx:1.13     Sat Sep 28 15:34:38 2002
--- gzz/gfx/libpaper/Paper.cxx  Mon Sep 30 02:44:22 2002
***************
*** 9,14 ****
--- 9,16 ----
  
  namespace Paper {
  
+   bool useVertexProgram = true;
+ 
      TexGen::TexGen(const float *tex_mat) {
        this->tex_mat[0] = tex_mat[0];
        this->tex_mat[1] = tex_mat[1];
***************
*** 329,335 ****
  
      GLenum unit = GL_TEXTURE0_ARB;
  
!     /* Multiplicates TexGen's explicit_mat with ppos for proper texCoords */
      for (vector<shared_ptr<TexGen> >::iterator it = texgen.begin(); it != 
texgen.end(); ++it) {
        if (it->get()) {
        mat = (*it)->explicit_mat;
--- 331,340 ----
  
      GLenum unit = GL_TEXTURE0_ARB;
  
!     /** Transforms paper position into proper texture coordinates.
!      * In other words, multiplicates explicit_mat transformation matrix 
!      * by ppos col vector.
!      */
      for (vector<shared_ptr<TexGen> >::iterator it = texgen.begin(); it != 
texgen.end(); ++it) {
        if (it->get()) {
        mat = (*it)->explicit_mat;
Index: gzz/gfx/libpaper/Paper.hxx
diff -c gzz/gfx/libpaper/Paper.hxx:1.12 gzz/gfx/libpaper/Paper.hxx:1.13
*** gzz/gfx/libpaper/Paper.hxx:1.12     Sat Sep 28 15:34:38 2002
--- gzz/gfx/libpaper/Paper.hxx  Mon Sep 30 02:44:22 2002
***************
*** 19,24 ****
--- 19,27 ----
   * backgrounds.
   */
  namespace Paper {
+     
+   /** Toggles (after 0.8Alpha4) the use of vertex program extension. */
+   extern bool useVertexProgram;
  
      using namespace Vec23;
  
***************
*** 92,103 ****
     */
    class TexGen {
    protected:
!     /** Matrix used to convert paper coordinates into texture coordinates. */
      // XXX: Currently the last four values are always initialized to 0,0,0,1
      float tex_mat[16];
      
    public:
!     /** Pointer to current texture matrix used in setUp_explicit */
      const float *explicit_mat;
        
      /** Creates a new TexGen.
--- 95,106 ----
     */
    class TexGen {
    protected:
!     /** Matrix used to transform paper position into texture coordinates. */
      // XXX: Currently the last four values are always initialized to 0,0,0,1
      float tex_mat[16];
      
    public:
!     /** Pointer to current translation matrix used in vertex_explicit(). */
      const float *explicit_mat;
        
      /** Creates a new TexGen.
***************
*** 125,142 ****
     */
    class TexGenEmboss : public TexGen {
    protected:
!     /** ??? */
      float eps;
!     /** Inverted tex_mat is needed by vertex_explicit() when
!      * handling TexGenEmbosses.
       */
!     float inv_tex_mat[16];
  
    public:
      /** Creates a new TexGen for embossing.
       * @param tex_mat A float vector of 12 elements, 
       * components of s, t and r vectors, respectively.
!      * @param eps ???
       */
      TexGenEmboss(const float *tex_mat, float eps) 
        : TexGen(tex_mat), eps(eps) {}
--- 128,145 ----
     */
    class TexGenEmboss : public TexGen {
    protected:
!     /** Amount to shift the texture towards the light. */
      float eps;
!     /**  When embossing (depends of LightParam), vertex_explicit() needs 
!      * a different matrix to transform paper position into texture 
coordinates.
       */
!     float explicit_tmp_mat[16];
  
    public:
      /** Creates a new TexGen for embossing.
       * @param tex_mat A float vector of 12 elements, 
       * components of s, t and r vectors, respectively.
!      * @param eps mount to shift the texture towrds the light
       */
      TexGenEmboss(const float *tex_mat, float eps) 
        : TexGen(tex_mat), eps(eps) {}
***************
*** 241,248 ****
       * @param ppos position within paper (array of 4 floats)
       */
      void vertex_VP(float *pos, float *ppos) {
!       glTexCoord4fv(ppos);
        glVertex4fv(pos);
      }
          
      /*** Explicit version of the rendering interface. */
--- 244,254 ----
       * @param ppos position within paper (array of 4 floats)
       */
      void vertex_VP(float *pos, float *ppos) {
!       vertex_VP(ppos);
        glVertex4fv(pos);
+     }
+     void vertex_VP(float *ppos) {
+       glTexCoord4fv(ppos);
      }
          
      /*** Explicit version of the rendering interface. */




reply via email to

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