/[gzz]/gzz/gfx/libtexture/irregu.texture
ViewVC logotype

Diff of /gzz/gfx/libtexture/irregu.texture

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13 by jvk, Tue Oct 29 11:53:53 2002 UTC revision 1.14 by jvk, Tue Oct 29 13:24:14 2002 UTC
# Line 30  void GENERATE(TextureParam *params, int Line 30  void GENERATE(TextureParam *params, int
30      FPARAM(eps, .25);      FPARAM(eps, .25);
31      FPARAM(invert, 0);      FPARAM(invert, 0);
32      FPARAM(quantize, 255);      FPARAM(quantize, 255);
33        FPARAM(angle, 0);
34      int angles = (int)params->getFloat("angles", 0);      int angles = (int)params->getFloat("angles", 0);
35            
36      // Note: radius is specified in texels      // Note: radius is specified in texels
# Line 94  void GENERATE(TextureParam *params, int Line 95  void GENERATE(TextureParam *params, int
95            
96      for (int comp = 0; comp < angles && comp < components; comp++) {      for (int comp = 0; comp < angles && comp < components; comp++) {
97    
98          float dx = cos(comp * M_PI / angles);          float dx = cos(comp * M_PI / angles + angle * (M_PI / 180));
99          float dy = sin(comp * M_PI / angles);          float dy = sin(comp * M_PI / angles + angle * (M_PI / 180));
100                    
101          ind = 0;          ind = 0;
102          for (j = 0, y = 0; j < height; j++, y += ystep) {                for (j = 0, y = 0; j < height; j++, y += ystep) {      
# Line 105  void GENERATE(TextureParam *params, int Line 106  void GENERATE(TextureParam *params, int
106                                    
107                  float maxh = -1E+10;                  float maxh = -1E+10;
108                  for (float r = -radius; r <= radius; r += eps) {                  for (float r = -radius; r <= radius; r += eps) {
109                      float h = filter(data + 3, width, height, components,                      float h = filter(data + 3, width, height, 4,
110                                       i + dx * r, j + dy * r);                                       i + dx * r, j + dy * r);
111    
112                      h += sqrt(radius * radius - r * r) * m;                      h += sqrt(radius * radius - r * r) * m;

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26