403 |
|
$kcal = ' |
404 |
|
DEGREE : PI/180; |
405 |
|
abs(x) : if(x, x, -x); |
406 |
< |
Acos(x) : 1/DEGREE * if(x-1, 0, if(-1-x, 0, acos(x))); |
406 |
> |
Acos(x) : if(x-1, 0, if(-1-x, PI, acos(x))) / DEGREE; |
407 |
|
posangle(a) : if(-a, a + 2*PI, a); |
408 |
< |
Atan2(y,x) : 1/DEGREE * posangle(atan2(y,x)); |
408 |
> |
Atan2(y,x) : posangle(atan2(y,x)) / DEGREE; |
409 |
|
kpola(r) : select(r, 5, 15, 25, 35, 45, 55, 65, 75, 90); |
410 |
|
knaz(r) : select(r, 1, 8, 16, 20, 24, 24, 24, 16, 12); |
411 |
|
kaccum(r) : if(r-.5, knaz(r) + kaccum(r-1), 0); |
463 |
|
system "$cmd" || die "Failure running: $cmd\n"; |
464 |
|
@tbarr = `$rccmd $td/$bmodnm.flt`; |
465 |
|
die "Failure running: $rccmd $td/$bmodnm.flt\n" if ( $? ); |
466 |
+ |
chomp(@tbarr); |
467 |
|
@rbarr = `$rccmd $td/$fmodnm.flt`; |
468 |
|
die "Failure running: $rccmd $td/$fmodnm.flt\n" if ( $? ); |
469 |
+ |
chomp(@rbarr); |
470 |
|
} |
471 |
|
# Output angle basis |
472 |
|
print |
586 |
|
<ScatteringDataType>BRDF</ScatteringDataType> |
587 |
|
<ScatteringData> |
588 |
|
'; |
589 |
< |
# Output front reflection (reciprocity averaging) |
589 |
> |
# Output front reflection (transposed order) |
590 |
|
for (my $od = 0; $od < $ndiv; $od++) { |
591 |
|
for (my $id = 0; $id < $ndiv; $id++) { |
592 |
< |
print .5*($rfarr[$ndiv*$id + $od] + $rfarr[$ndiv*$od + $id]), ",\n"; |
592 |
> |
print $rfarr[$ndiv*$id + $od], ",\n"; |
593 |
|
} |
594 |
|
print "\n"; |
595 |
|
} |
639 |
|
# Output back reflection (reciprocity averaging) |
640 |
|
for (my $od = 0; $od < $ndiv; $od++) { |
641 |
|
for (my $id = 0; $id < $ndiv; $id++) { |
642 |
< |
print .5*($rbarr[$ndiv*$id + $od] + $rbarr[$ndiv*$od + $id]), ",\n"; |
642 |
> |
print $rbarr[$ndiv*$id + $od], ",\n"; |
643 |
|
} |
644 |
|
print "\n"; |
645 |
|
} |