--- ray/src/util/rsensor.c 2008/02/22 18:04:02 2.3 +++ ray/src/util/rsensor.c 2008/04/11 22:06:04 2.5 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rsensor.c,v 2.3 2008/02/22 18:04:02 greg Exp $"; +static const char RCSid[] = "$Id: rsensor.c,v 2.5 2008/04/11 22:06:04 greg Exp $"; #endif /* @@ -22,7 +22,9 @@ extern char *progname; /* global argv[0] */ extern int nowarn; /* don't report warnings? */ /* current sensor's perspective */ -VIEW ourview = STDVIEW; +VIEW ourview = {VT_ANG,{0.,0.,0.},{0.,0.,1.},{1.,0.,0.}, + 1.,180.,180.,0.,0.,0.,0., + {0.,0.,0.},{0.,0.,0.},0.,0.}; unsigned long nsamps = 10000; /* desired number of initial samples */ unsigned long nssamps = 9000; /* number of super-samples */ @@ -374,12 +376,6 @@ init_ptable( "code error 2 in init_ptable()"); frac1 = 1. + prob/((1.-frac)*rowp[p]/rowsum[t] + frac*rowp1[p]/rowsum[t+1]); - if (p <= 0 || frac1 > 0.5) - frac1 -= 0.5; - else if (p >= sntp[1]-1 || frac1 < 0.5) { - frac1 += 0.5; - --p; - } pvals[i*(nphi+1) + j] = (1.-frac1)*phdiv[p] + frac1*phdiv[p+1]; } @@ -479,11 +475,13 @@ comp_sensor( setcolor(vsum, .0f, .0f, .0f); nt = (int)(sqrt((double)nsamps*ntheta/nphi) + .5); np = nsamps/nt; - VCOPY(rr.rorg, ourview.vp); - rr.rmax = .0; for (i = 0; i < nt; i++) for (j = 0; j < np; j++) { + VCOPY(rr.rorg, ourview.vp); get_direc(rr.rdir, (i+frandom())/nt, (j+frandom())/np); + if (ourview.vfore > FTINY) + VSUM(rr.rorg, rr.rorg, rr.rdir, ourview.vfore); + rr.rmax = .0; rayorigin(&rr, PRIMARY, NULL, NULL); if (ray_pqueue(&rr) == 1) addcolor(vsum, rr.rcol);