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 |
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 |
|
|
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 |
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 */ |