gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gfx demo/texlab.py libpaper/textures.py lib...


From: Janne V. Kujala
Subject: [Gzz-commits] gzz/gfx demo/texlab.py libpaper/textures.py lib...
Date: Wed, 09 Oct 2002 10:48:20 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Janne V. Kujala <address@hidden>        02/10/09 10:48:20

Modified files:
        gfx/demo       : texlab.py 
        gfx/libpaper   : textures.py 
        gfx/libtexture : fnoise.texture 

Log message:
        Add some more textures

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/texlab.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/textures.py.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libtexture/fnoise.texture.diff?tr1=1.5&tr2=1.6&r1=text&r2=text

Patches:
Index: gzz/gfx/demo/texlab.py
diff -c gzz/gfx/demo/texlab.py:1.6 gzz/gfx/demo/texlab.py:1.7
*** gzz/gfx/demo/texlab.py:1.6  Wed Oct  9 10:07:27 2002
--- gzz/gfx/demo/texlab.py      Wed Oct  9 10:48:20 2002
***************
*** 11,27 ****
  
  tres = 128
  args = [
!     #[tres, tres, 0, 4, "RGBA", "RGBA", "fnoise",
!     #               ["scale", "2.5", "freq", "1", "df", "2", "bias", "0.5"]],
      [tres, tres, 0, 4, "RGBA", "RGBA", "fnoise",
!      ["scale", ".43", "freq", "1", "df", "2", "bias", "0.5",
!       "seed", "1412"]],
      [tres, tres, 0, 4, "RGBA", "RGBA", "fnoise",
!      ["scale", ".43", "freq", "1", "df", "2", "bias", "0.5",
!       "seed", "141265"]],
      [tres, tres, 0, 4, "RGBA", "RGBA", "fnoise",
       ["turb", "1", "scale", ".3", "freq", "1",
!       "freq2", "100", "df", "2", "bias", "0"]],
      [64, 64, 0, 4, "RGBA", "RGBA", "geometric", ["type", "0"]],
      [64, 64, 0, 4, "RGBA", "RGBA", "geometric", ["type", "1"]],
      [64, 64, 0, 4, "RGBA", "RGBA", "geometric", ["type", "2"]],
--- 11,33 ----
  
  tres = 128
  args = [
!     [tres, tres, 0, 3, "RGB", "RGB", "fnoise",
!      ["scale", ".43", "freq", ".75", "df", "1", "bias", "0.5", "seed", "2323" 
]],
!     [tres, tres, 0, 3, "RGB", "RGB", "fnoise",
!      ["scale", ".43", "freq", "1", "df", "1.5", "bias", "0.5" ]],
!     [tres, tres, 0, 3, "RGB", "RGB", "fnoise",
!      ["scale", ".43", "freq", "1", "df", "5", "bias", "0.5",
!       "seed", "141", "aniso", "2"]],
!     
      [tres, tres, 0, 4, "RGBA", "RGBA", "fnoise",
!      ["scale", ".43", "freq", "1", "df", "1.5", "bias", "0.5" ]],
!     
      [tres, tres, 0, 4, "RGBA", "RGBA", "fnoise",
!      ["scale", ".43", "freq", "1", "df", "8", "bias", "0.5",
!       "seed", "141", "aniso", "2"]],
      [tres, tres, 0, 4, "RGBA", "RGBA", "fnoise",
       ["turb", "1", "scale", ".3", "freq", "1",
!       "freq2", "100", "df", "1", "bias", "0"]],
      [64, 64, 0, 4, "RGBA", "RGBA", "geometric", ["type", "0"]],
      [64, 64, 0, 4, "RGBA", "RGBA", "geometric", ["type", "1"]],
      [64, 64, 0, 4, "RGBA", "RGBA", "geometric", ["type", "2"]],
Index: gzz/gfx/libpaper/textures.py
diff -c gzz/gfx/libpaper/textures.py:1.21 gzz/gfx/libpaper/textures.py:1.22
*** gzz/gfx/libpaper/textures.py:1.21   Wed Oct  9 10:07:27 2002
--- gzz/gfx/libpaper/textures.py        Wed Oct  9 10:48:20 2002
***************
*** 77,100 ****
      global initialized
      initialized = 1
      global ptextures
!     ptextures["RGB2"] = map(NamedTexture, [
! #        {"name" : "rgbw1",
! #         "args" : [tres, tres, 0, 3, "RGB", "RGB", "fnoise",
! #                   ["scale", "2.5", "freq", "1", "df", "2", "bias", "0.5"]],
! #         "scale" : 1./8,
! #         },
          
          {"name" : "rgbw2",
           "args" : [tres, tres, 0, 3, "RGB", "RGB", "fnoise",
!                    ["scale", ".43", "freq", "1", "df", "2", "bias", "0.5",
!                     "seed", "1412"]],
           "scale" : 1./2,
           },
!         
          {"name" : "turb",
           "args" : [tres, tres, 0, 3, "RGB", "RGB", "fnoise",
                     ["turb", "1", "scale", ".3", "freq", "1",
!                     "freq2", "100", "df", "2", "bias", "0"]],
           "scale" : 1./8,
           },
          
--- 77,119 ----
      global initialized
      initialized = 1
      global ptextures
!     ptextures["RGB2"] = map(NamedTexture, filter(lambda dict: dict["name"] in 
[
!         "rgbw1",
!         "rgbw2",
!         "rgbw3",
!         "turb",
!         "pyramid",
!         "checkerboard",
!         "cone",
!         "checkerboard2",
!         "saw",
!         "triangle",
!         "stripe",
!         ], [
!         {"name" : "rgbw1",
!          "args" : [tres, tres, 0, 3, "RGB", "RGB", "fnoise",
!                    ["scale", ".43", "freq", ".75", "df", "1", "bias", "0.5", 
"seed", "2323" ]],
!          "scale" : 1./2,
!          },
          
          {"name" : "rgbw2",
           "args" : [tres, tres, 0, 3, "RGB", "RGB", "fnoise",
!                    ["scale", ".43", "freq", "1", "df", "1.5", "bias", "0.5" 
]],
           "scale" : 1./2,
           },
! 
! 
!         {"name" : "rgbw3",
!          "args" : [tres, tres, 0, 3, "RGB", "RGB", "fnoise",
!                    ["scale", ".43", "freq", "1", "df", "5", "bias", "0.5",
!                     "seed", "141", "aniso", "2"]],
!          "scale" : 1./2,
!          },
! 
          {"name" : "turb",
           "args" : [tres, tres, 0, 3, "RGB", "RGB", "fnoise",
                     ["turb", "1", "scale", ".3", "freq", "1",
!                     "freq2", "100", "df", "1", "bias", "0"]],
           "scale" : 1./8,
           },
          
***************
*** 144,150 ****
           "minfilter" : "NEAREST",
           "magfilter" : "NEAREST",
           },
!         ])
      
  def getPaperTexture(type, gen):
      return selectRandom(ptextures[type], gen)
--- 163,169 ----
           "minfilter" : "NEAREST",
           "magfilter" : "NEAREST",
           },
!         ]))
      
  def getPaperTexture(type, gen):
      return selectRandom(ptextures[type], gen)
Index: gzz/gfx/libtexture/fnoise.texture
diff -c gzz/gfx/libtexture/fnoise.texture:1.5 
gzz/gfx/libtexture/fnoise.texture:1.6
*** gzz/gfx/libtexture/fnoise.texture:1.5       Mon Sep 30 12:23:21 2002
--- gzz/gfx/libtexture/fnoise.texture   Wed Oct  9 10:48:20 2002
***************
*** 11,18 ****
  /* Add a fourier noise to the data.
   */
  static void fourier_noise(int width, int height, int depth, int components, 
float *data, 
!               float freq, float df) {
!     int nf = (int)(2 * freq);
      float xsin[2][nf][width];
      for(int i=0; i<width; i++) 
        for(int f = 0; f < nf; f++) {
--- 11,18 ----
  /* Add a fourier noise to the data.
   */
  static void fourier_noise(int width, int height, int depth, int components, 
float *data, 
!               float freq, float df, float aniso = 1.0) {
!     int nf = (int)(2 * (freq + df) * aniso);
      float xsin[2][nf][width];
      for(int i=0; i<width; i++) 
        for(int f = 0; f < nf; f++) {
***************
*** 34,40 ****
        for(int xf = 0; xf < nf; xf++) {
          for(int yf = 0; yf < nf; yf++) {
  
!           double f = sqrt(xf*xf + yf*yf);
            if(f < freq-df || f > freq+df) continue;
  
            for(int xsc = 0; xsc < 2; xsc++) {
--- 34,40 ----
        for(int xf = 0; xf < nf; xf++) {
          for(int yf = 0; yf < nf; yf++) {
  
!           double f = sqrt(xf*xf + yf*yf*(aniso*aniso));
            if(f < freq-df || f > freq+df) continue;
  
            for(int xsc = 0; xsc < 2; xsc++) {
***************
*** 78,83 ****
--- 78,84 ----
      FPARAM(bias, 0);
      FPARAM(scale, 1);
      FPARAM(freq, 5);
+     FPARAM(aniso, 1.0);
      FPARAM(df, 2);
      FPARAM(seed, 0);
      FPARAM(turb, 0);
***************
*** 98,104 ****
        for (float f = freq; f <= freq2; f += f) {
        for(int i = 0; i<n; i++)
          tmp[i] = 0;
!       fourier_noise(width,height,d,components,tmp, f, df);
  
        float m = 1.0 / (log(f)/log(2) + 1);
        
--- 99,105 ----
        for (float f = freq; f <= freq2; f += f) {
        for(int i = 0; i<n; i++)
          tmp[i] = 0;
!       fourier_noise(width,height,d,components,tmp, f, df, aniso);
  
        float m = 1.0 / (log(f)/log(2) + 1);
        
***************
*** 111,117 ****
  
      } else {
  
!       fourier_noise(width,height,d,components,data, freq, df);
      }
      
      for(int i = 0; i<n; i++) {
--- 112,118 ----
  
      } else {
  
!       fourier_noise(width,height,d,components,data, freq, df, aniso);
      }
      
      for(int i = 0; i<n; i++) {




reply via email to

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