334 |
|
static void |
335 |
|
init(void) /* perform final setup */ |
336 |
|
{ |
337 |
– |
double l_colin(char *), l_expos(char *), l_pixaspect(char *), |
338 |
– |
l_ray(char *), l_psize(char *); |
337 |
|
register int i; |
338 |
|
/* define constants */ |
339 |
|
varset("PI", ':', PI); |
439 |
|
eputs(": read error\n"); |
440 |
|
quit(1); |
441 |
|
} |
442 |
< |
if (fabs(colval(input[i].coef,RED)-1.0) > 1e-3 || |
443 |
< |
fabs(colval(input[i].coef,GRN)-1.0) > 1e-3 || |
446 |
< |
fabs(colval(input[i].coef,BLU)-1.0) > 1e-3) |
447 |
< |
for (j = 0; j < xmax; j++) /* adjust color */ |
448 |
< |
multcolor(st[j], input[i].coef); |
442 |
> |
for (j = 0; j < xmax; j++) /* adjust color */ |
443 |
> |
multcolor(st[j], input[i].coef); |
444 |
|
} |
445 |
|
} |
446 |
|
|
598 |
|
if (input[fn].vw.type == 0) |
599 |
|
errno = EDOM; |
600 |
|
else if (input[fn].vw.type != VT_PAR && |
601 |
< |
funvalue(vray[6], 1, &d) >= 0) { |
601 |
> |
funvalue(vray[6], 1, &d) >= -FTINY) { |
602 |
|
for (i = 0; i < 3; i++) |
603 |
|
dir0[i] = funvalue(vray[3+i], 1, &d); |
604 |
|
pix2loc(locx, &input[fn].rs, xscan+1, ymax-1-yscan); |
605 |
|
pix2loc(locy, &input[fn].rs, xscan, ymax-yscan); |
606 |
|
if (viewray(org, dirx, &input[fn].vw, |
607 |
< |
locx[0], locx[1]) >= 0 && |
607 |
> |
locx[0], locx[1]) >= -FTINY && |
608 |
|
viewray(org, diry, &input[fn].vw, |
609 |
< |
locy[0], locy[1]) >= 0) { |
609 |
> |
locy[0], locy[1]) >= -FTINY) { |
610 |
|
/* approximate solid angle */ |
611 |
|
for (i = 0; i < 3; i++) { |
612 |
|
dirx[i] -= dir0[i]; |
613 |
|
diry[i] -= dir0[i]; |
614 |
|
} |
615 |
|
fcross(dir0, dirx, diry); |
616 |
< |
psize[fn] = sqrt(DOT(dir0,dir0)); |
616 |
> |
psize[fn] = VLEN(dir0); |
617 |
|
} |
618 |
|
} |
619 |
|
ltick[fn] = eclock; |