| 145 |
|
return(1); |
| 146 |
|
} |
| 147 |
|
|
| 148 |
< |
#if 1 |
| 148 |
> |
#ifndef TEST_MAIN |
| 149 |
|
/* Read in PAB-Opto BSDF files and output RBF interpolant */ |
| 150 |
|
int |
| 151 |
|
main(int argc, char *argv[]) |
| 222 |
|
for (j = 0; j < GRIDRES; j++) |
| 223 |
|
if (dsf_grid[i][j].nval > 0) { |
| 224 |
|
ovec_from_pos(dir, i, j); |
| 225 |
< |
bsdf = dsf_grid[i][j].vsum/(dsf_grid[i][j].nval*dir[2]); |
| 225 |
> |
bsdf = dsf_grid[i][j].vsum / |
| 226 |
> |
(dsf_grid[i][j].nval*output_orient*dir[2]); |
| 227 |
|
if (bsdf <= bsdf_min*.6) |
| 228 |
|
continue; |
| 229 |
|
bsdf = log(bsdf) - min_log; |
| 239 |
|
sprintf(buf, "gensurf tgreen bsdf - - - %d %d", GRIDRES-1, GRIDRES-1); |
| 240 |
|
pfp = popen(buf, "w"); |
| 241 |
|
if (pfp == NULL) { |
| 242 |
< |
fputs(buf, stderr); |
| 242 |
< |
fputs(": cannot start command\n", stderr); |
| 242 |
> |
fprintf(stderr, "%s: cannot open '| %s'\n", argv[0], buf); |
| 243 |
|
return(1); |
| 244 |
|
} |
| 245 |
|
for (i = 0; i < GRIDRES; i++) |
| 246 |
|
for (j = 0; j < GRIDRES; j++) { |
| 247 |
|
ovec_from_pos(dir, i, j); |
| 248 |
< |
bsdf = eval_rbfrep(dsf_list, dir) / dir[2]; |
| 248 |
> |
bsdf = eval_rbfrep(dsf_list, dir) / (output_orient*dir[2]); |
| 249 |
|
bsdf = log(bsdf) - min_log; |
| 250 |
|
fprintf(pfp, "%.8e %.8e %.8e\n", |
| 251 |
|
dir[0]*bsdf, dir[1]*bsdf, dir[2]*bsdf); |