| 5 |
|
* Plot 3-D BSDF output based on scattering interpolant or XML representation |
| 6 |
|
*/ |
| 7 |
|
|
| 8 |
– |
#include <stdio.h> |
| 9 |
– |
#include <string.h> |
| 8 |
|
#include <stdlib.h> |
| 9 |
+ |
#include "rtio.h" |
| 10 |
|
#include "paths.h" |
| 11 |
|
#include "rtmath.h" |
| 13 |
– |
#include "resolu.h" |
| 12 |
|
#include "bsdfrep.h" |
| 13 |
|
|
| 14 |
|
#ifndef NINCIDENT |
| 41 |
|
#define bsdf_rad (sph_rad*.25) |
| 42 |
|
#define arrow_rad (bsdf_rad*.015) |
| 43 |
|
|
| 46 |
– |
#define FEQ(a,b) ((a)-(b) <= 1e-7 && (b)-(a) <= 1e-7) |
| 47 |
– |
|
| 44 |
|
#define set_minlog() overall_min = (overall_min < 1e-5) ? 1e-5 : overall_min; \ |
| 45 |
|
min_log10 = log10(overall_min) - .1 |
| 46 |
|
|
| 144 |
|
SDValue sval; |
| 145 |
|
double bsdf; |
| 146 |
|
ovec_from_pos(ovec, i*GRIDSTEP, j*GRIDSTEP); |
| 147 |
< |
if (SDreportError(SDevalBSDF(&sval, ovec, |
| 148 |
< |
ivec, sd), stderr)) |
| 147 |
> |
if (SDreportError(SDevalBSDF(&sval, ivec, |
| 148 |
> |
ovec, sd), stderr)) |
| 149 |
|
return(0); |
| 150 |
|
if (sval.cieY > overall_max) |
| 151 |
|
overall_max = sval.cieY; |
| 346 |
|
return(4); |
| 347 |
|
} |
| 348 |
|
theta = atan2(yp[2], zp[2]); |
| 349 |
< |
if (!FEQ(theta,0.0)) { |
| 349 |
> |
if (!FABSEQ(theta,0.0)) { |
| 350 |
|
sprintf(xf, " -rx %f", theta*(180./PI)); |
| 351 |
|
while (*xf) ++xf; |
| 352 |
|
n += 2; |
| 353 |
|
} |
| 354 |
|
theta = Asin(-xp[2]); |
| 355 |
< |
if (!FEQ(theta,0.0)) { |
| 355 |
> |
if (!FABSEQ(theta,0.0)) { |
| 356 |
|
sprintf(xf, " -ry %f", theta*(180./PI)); |
| 357 |
|
while (*xf) ++xf; |
| 358 |
|
n += 2; |
| 359 |
|
} |
| 360 |
|
theta = atan2(xp[1], xp[0]); |
| 361 |
< |
if (!FEQ(theta,0.0)) { |
| 361 |
> |
if (!FABSEQ(theta,0.0)) { |
| 362 |
|
sprintf(xf, " -rz %f", theta*(180./PI)); |
| 363 |
|
/* while (*xf) ++xf; */ |
| 364 |
|
n += 2; |
| 752 |
|
overall_min = myBSDF.rLambFront.cieY/PI; |
| 753 |
|
if (back_comp & SDsampR && myBSDF.rLambBack.cieY < overall_min*PI) |
| 754 |
|
overall_min = myBSDF.rLambBack.cieY/PI; |
| 755 |
< |
if ((front_comp|back_comp) & SDsampT && |
| 756 |
< |
myBSDF.tLamb.cieY < overall_min*PI) |
| 757 |
< |
overall_min = myBSDF.tLamb.cieY/PI; |
| 755 |
> |
if (front_comp & SDsampT && myBSDF.tLambFront.cieY < overall_min*PI) |
| 756 |
> |
overall_min = myBSDF.tLambFront.cieY/PI; |
| 757 |
> |
if (back_comp & SDsampT && myBSDF.tLambBack.cieY < overall_min*PI) |
| 758 |
> |
overall_min = myBSDF.tLambBack.cieY/PI; |
| 759 |
|
} |
| 760 |
|
set_minlog(); |
| 761 |
|
if (!build_wBSDF(&myBSDF)) |