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.11 by greg, Fri Sep 3 21:16:50 2010 UTC

# Line 39 | Line 39 | static char  noise_name[4][8] = {"noise3x", "noise3y",
39   static char  fnoise_name[] = "fnoise3";
40   static char  hermite_name[] = "hermite";
41  
42 //double  *noise3(), fnoise3(), frand();
43 //static  interpolate();
44
42   static long  xlim[3][2];
43   static double  xarg[3];
44  
# Line 221 | Line 218 | fnoise3(                       /* compute fractal noise function */
218                          v[i] = beg[i] + s;
219                  }
220                  for (i = 0; i < 3; i++) {       /* do edges */
221 <                        j = (i+1)%3;
221 >                        if ((j = i+1) == 3) j = 0;
222                          if (branch & 1<<j)
223                                  v[j] += s;
224                          else
225                                  v[j] -= s;
226 <                        j = (i+2)%3;
226 >                        if (++j == 3) j = 0;
227                          if (branch & 1<<j)
228                                  v[j] += s;
229                          else
# Line 235 | Line 232 | fnoise3(                       /* compute fractal noise function */
232                          fc += fval[branch | 1<<i];
233                          fc = 0.5*fc + s*EPSILON*frand3(v[0],v[1],v[2]);
234                          fval[branch^1<<i] = fc;
235 <                        j = (i+1)%3;
235 >                        if ((j = i+1) == 3) j = 0;
236                          v[j] = beg[j] + s;
237 <                        j = (i+2)%3;
237 >                        if (++j == 3) j = 0;
238                          v[j] = beg[j] + s;
239                  }
240                  for (i = 0; i < 3; i++)         /* new cube */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines