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 |
|
|
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; |
672 |
|
static int |
673 |
|
rbf_headline(char *s, void *p) |
674 |
|
{ |
675 |
< |
char fmt[64]; |
675 |
> |
char fmt[MAXFMTLEN]; |
676 |
|
|
677 |
|
if (formatval(fmt, s)) { |
678 |
|
if (strcmp(fmt, BSDFREP_FMT)) |