190 |
|
fputs(VIEWSTR, stdout); |
191 |
|
fprintview(&ourview, stdout); |
192 |
|
printf("\n"); |
193 |
< |
fputformat("ASCII", stdout); |
193 |
> |
fputformat("ascii", stdout); |
194 |
|
printf("\n"); |
195 |
|
printsources(); /* print glare sources */ |
196 |
|
printillum(); /* print illuminances */ |
300 |
|
FVECT org; /* dummy variable */ |
301 |
|
|
302 |
|
hl = hlim(y); |
303 |
< |
if (x <= -hl) /* left region */ |
303 |
> |
if (x <= -hl) { /* left region */ |
304 |
> |
if (x <= -hl-sampdens) |
305 |
> |
return(-1); |
306 |
|
return(viewray(org, vd, &leftview, |
307 |
|
(double)(x+hl)/(2*sampdens)+.5, |
308 |
|
(double)y/(2*sampdens)+.5)); |
309 |
< |
if (x >= hl) /* right region */ |
309 |
> |
} |
310 |
> |
if (x >= hl) { /* right region */ |
311 |
> |
if (x >= hl+sampdens) |
312 |
> |
return(-1); |
313 |
|
return(viewray(org, vd, &rightview, |
314 |
|
(double)(x-hl)/(2*sampdens)+.5, |
315 |
|
(double)y/(2*sampdens)+.5)); |
316 |
+ |
} |
317 |
|
/* central region */ |
318 |
|
if (viewray(org, vd, &ourview, .5, (double)y/(2*sampdens)+.5) < 0) |
319 |
|
return(-1); |
336 |
|
xo = x-hl; |
337 |
|
else |
338 |
|
xo = 0; |
339 |
< |
disc = 1. - (xo*xo + y*y)/(sampdens*sampdens); |
339 |
> |
disc = 1. - (double)(xo*xo + y*y)/(sampdens*sampdens); |
340 |
|
if (disc <= FTINY) |
341 |
|
return(0.); |
342 |
|
return(1./(sampdens*sampdens*sqrt(disc))); |