22 |
|
extern int nowarn; /* don't report warnings? */ |
23 |
|
|
24 |
|
/* current sensor's perspective */ |
25 |
< |
VIEW ourview = STDVIEW; |
25 |
> |
VIEW ourview = {VT_ANG,{0.,0.,0.},{0.,0.,1.},{1.,0.,0.}, |
26 |
> |
1.,180.,180.,0.,0.,0.,0., |
27 |
> |
{0.,0.,0.},{0.,0.,0.},0.,0.}; |
28 |
|
|
29 |
|
unsigned long nsamps = 10000; /* desired number of initial samples */ |
30 |
|
unsigned long nssamps = 9000; /* number of super-samples */ |
376 |
|
"code error 2 in init_ptable()"); |
377 |
|
frac1 = 1. + prob/((1.-frac)*rowp[p]/rowsum[t] |
378 |
|
+ frac*rowp1[p]/rowsum[t+1]); |
377 |
– |
if (p <= 0 || frac1 > 0.5) |
378 |
– |
frac1 -= 0.5; |
379 |
– |
else if (p >= sntp[1]-1 || frac1 < 0.5) { |
380 |
– |
frac1 += 0.5; |
381 |
– |
--p; |
382 |
– |
} |
379 |
|
pvals[i*(nphi+1) + j] = (1.-frac1)*phdiv[p] + |
380 |
|
frac1*phdiv[p+1]; |
381 |
|
} |
475 |
|
setcolor(vsum, .0f, .0f, .0f); |
476 |
|
nt = (int)(sqrt((double)nsamps*ntheta/nphi) + .5); |
477 |
|
np = nsamps/nt; |
482 |
– |
VCOPY(rr.rorg, ourview.vp); |
483 |
– |
rr.rmax = .0; |
478 |
|
for (i = 0; i < nt; i++) |
479 |
|
for (j = 0; j < np; j++) { |
480 |
+ |
VCOPY(rr.rorg, ourview.vp); |
481 |
|
get_direc(rr.rdir, (i+frandom())/nt, (j+frandom())/np); |
482 |
+ |
if (ourview.vfore > FTINY) |
483 |
+ |
VSUM(rr.rorg, rr.rorg, rr.rdir, ourview.vfore); |
484 |
+ |
rr.rmax = .0; |
485 |
|
rayorigin(&rr, PRIMARY, NULL, NULL); |
486 |
|
if (ray_pqueue(&rr) == 1) |
487 |
|
addcolor(vsum, rr.rcol); |