362 |
|
case ' ': |
363 |
|
case '\t': |
364 |
|
case '\r': |
365 |
– |
continue; |
365 |
|
case '\n': |
366 |
+ |
continue; |
367 |
|
case '\0': |
368 |
|
return(nparams); |
369 |
|
default: |
417 |
|
} |
418 |
|
/* determine sample type/bin */ |
419 |
|
if (tolower(curparams.hemis[0]) == 'u' | curparams.hemis[0] == '1') { |
420 |
< |
binv = "0"; /* uniform sampling -- one bin */ |
420 |
> |
sprintf(sbuf, "if(-Dx*%g-Dy*%g-Dz*%g,0,-1)", |
421 |
> |
curparams.nrm[0], curparams.nrm[1], curparams.nrm[2]); |
422 |
> |
binv = savqstr(sbuf); |
423 |
> |
nbins = "1"; /* uniform sampling -- one bin */ |
424 |
|
uniform = 1; |
425 |
|
} else if (tolower(curparams.hemis[0]) == 's' && |
426 |
|
tolower(curparams.hemis[1]) == 'c') { |
519 |
|
{ |
520 |
|
int i; |
521 |
|
|
522 |
< |
uva[1][0] = 0.5 - frandom(); |
520 |
< |
uva[1][1] = 0.5 - frandom(); |
521 |
< |
uva[1][2] = 0.5 - frandom(); |
522 |
< |
for (i = 3; i--; ) |
523 |
< |
if ((-0.6 < nrm[i]) & (nrm[i] < 0.6)) |
524 |
< |
break; |
525 |
< |
if (i < 0) { |
522 |
> |
if (!getperpendicular(uva[0], nrm)) { |
523 |
|
fputs(progname, stderr); |
524 |
|
fputs(": bad surface normal in make_axes!\n", stderr); |
525 |
|
exit(1); |
526 |
|
} |
527 |
< |
uva[1][i] = 1.0; |
531 |
< |
VCROSS(uva[0], uva[1], nrm); |
532 |
< |
normalize(uva[0]); |
533 |
< |
VCROSS(uva[1], nrm, uva[0]); |
527 |
> |
fcross(uva[1], nrm, uva[0]); |
528 |
|
} |
529 |
|
|
530 |
|
/* Illegal sender surfaces end up here */ |