14 |
|
#include <math.h> |
15 |
|
#include "platform.h" |
16 |
|
#include "bsdfrep.h" |
17 |
+ |
#include "resolu.h" |
18 |
|
/* global argv[0] */ |
19 |
|
char *progname; |
20 |
|
|
232 |
|
(dsf_grid[i][j].nval*output_orient*dir[2]); |
233 |
|
if (bsdf <= bsdf_min*.6) |
234 |
|
continue; |
235 |
< |
bsdf = log(bsdf) - min_log; |
235 |
> |
bsdf = log(bsdf + 1e-5) - min_log; |
236 |
|
ovec_from_pos(dir, i, j); |
237 |
|
printf("yellow sphere s%04d\n0\n0\n", ++n); |
238 |
|
printf("4 %.6g %.6g %.6g %.6g\n\n", |
246 |
|
RBFVAL *rbf = &dsf_list->rbfa[n]; |
247 |
|
ovec_from_pos(dir, rbf->gx, rbf->gy); |
248 |
|
bsdf = eval_rbfrep(dsf_list, dir) / (output_orient*dir[2]); |
249 |
< |
bsdf = log(bsdf) - min_log; |
249 |
> |
bsdf = log(bsdf + 1e-5) - min_log; |
250 |
|
printf("red sphere p%04d\n0\n0\n", ++n); |
251 |
|
printf("4 %.6g %.6g %.6g %.6g\n\n", |
252 |
|
dir[0]*bsdf, dir[1]*bsdf, dir[2]*bsdf, |
266 |
|
for (j = 0; j < GRIDRES; j++) { |
267 |
|
ovec_from_pos(dir, i, j); |
268 |
|
bsdf = eval_rbfrep(dsf_list, dir) / (output_orient*dir[2]); |
269 |
< |
bsdf = log(bsdf) - min_log; |
269 |
> |
bsdf = log(bsdf + 1e-5) - min_log; |
270 |
|
fprintf(pfp, "%.8e %.8e %.8e\n", |
271 |
|
dir[0]*bsdf, dir[1]*bsdf, dir[2]*bsdf); |
272 |
|
} |