11 |
|
#include "ray.h" |
12 |
|
#include "platform.h" |
13 |
|
#include "source.h" |
14 |
+ |
#include "func.h" |
15 |
|
#include "view.h" |
16 |
|
#include "random.h" |
17 |
|
|
20 |
|
#define MAXNT 181 /* maximum number of theta divisions */ |
21 |
|
#define MAXNP 360 /* maximum number of phi divisions */ |
22 |
|
|
22 |
– |
extern char *progname; /* global argv[0] */ |
23 |
|
extern int nowarn; /* don't report warnings? */ |
24 |
|
|
25 |
|
/* current sensor's perspective */ |
92 |
|
int doheader = 1; |
93 |
|
int optwarn = 0; |
94 |
|
int i, rval; |
95 |
< |
|
96 |
< |
progname = argv[0]; |
95 |
> |
/* set global progname */ |
96 |
> |
fixargv0(argv[0]); |
97 |
|
/* set up rendering defaults */ |
98 |
|
rand_samp = 1; |
99 |
|
dstrsrc = 0.65; |
101 |
|
directrelay = 3; |
102 |
|
ambounce = 1; |
103 |
|
maxdepth = -10; |
104 |
+ |
/* initialize calcomp routines */ |
105 |
+ |
initfunc(); |
106 |
|
/* get options from command line */ |
107 |
|
for (i = 1; i < argc; i++) { |
108 |
|
while ((rval = expandarg(&argc, &argv, i)) > 0) |
524 |
|
char *err; |
525 |
|
int nt, np; |
526 |
|
SCOLOR vsum; |
525 |
– |
COLOR cres; |
527 |
|
RAY rr; |
528 |
|
double sf; |
529 |
|
int i, j; |
593 |
|
} |
594 |
|
} |
595 |
|
} |
596 |
< |
/* finish our calculation */ |
596 |
< |
while (ray_presult(&rr, 0) > 0) { |
596 |
> |
while (ray_presult(&rr, 0) > 0) { /* finish our calculation */ |
597 |
|
smultscolor(rr.rcol, rr.rcoef); |
598 |
|
saddscolor(vsum, rr.rcol); |
599 |
|
} |
600 |
< |
/* print our result */ |
601 |
< |
scolor_rgb(cres, vsum); |
602 |
< |
printf("%.4e %.4e %.4e\n", colval(cres,RED), |
603 |
< |
colval(cres,GRN), colval(cres,BLU)); |
600 |
> |
for (i = 0; i < NCSAMP; i++) /* print our result */ |
601 |
> |
printf(" %.4e", vsum[i]); |
602 |
> |
fputc('\n', stdout); |
603 |
|
} |