ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/noise3.c
(Generate patch)

Comparing ray/src/rt/noise3.c (file contents):
Revision 2.9 by schorsch, Tue Mar 30 16:13:01 2004 UTC vs.
Revision 2.12 by greg, Tue Feb 22 16:45:12 2011 UTC

# Line 10 | Line 10 | static const char      RCSid[] = "$Id$";
10  
11   #include "copyright.h"
12  
13 < #include  <math.h>
14 <
15 < #include  "calcomp.h"
13 > #include  "ray.h"
14   #include  "func.h"
15  
16   #define  A              0
# Line 39 | Line 37 | static char  noise_name[4][8] = {"noise3x", "noise3y",
37   static char  fnoise_name[] = "fnoise3";
38   static char  hermite_name[] = "hermite";
39  
42 //double  *noise3(), fnoise3(), frand();
43 //static  interpolate();
44
40   static long  xlim[3][2];
41   static double  xarg[3];
42  
# Line 221 | Line 216 | fnoise3(                       /* compute fractal noise function */
216                          v[i] = beg[i] + s;
217                  }
218                  for (i = 0; i < 3; i++) {       /* do edges */
219 <                        j = (i+1)%3;
219 >                        if ((j = i+1) == 3) j = 0;
220                          if (branch & 1<<j)
221                                  v[j] += s;
222                          else
223                                  v[j] -= s;
224 <                        j = (i+2)%3;
224 >                        if (++j == 3) j = 0;
225                          if (branch & 1<<j)
226                                  v[j] += s;
227                          else
# Line 235 | Line 230 | fnoise3(                       /* compute fractal noise function */
230                          fc += fval[branch | 1<<i];
231                          fc = 0.5*fc + s*EPSILON*frand3(v[0],v[1],v[2]);
232                          fval[branch^1<<i] = fc;
233 <                        j = (i+1)%3;
233 >                        if ((j = i+1) == 3) j = 0;
234                          v[j] = beg[j] + s;
235 <                        j = (i+2)%3;
235 >                        if (++j == 3) j = 0;
236                          v[j] = beg[j] + s;
237                  }
238                  for (i = 0; i < 3; i++)         /* new cube */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines