| 23 |
|
# options we need to silently ignore |
| 24 |
|
my %ignoreC = ("-t",1, "-ps",1, "-pt",1, "-pm",1); |
| 25 |
|
# Starting options for rtrace (rpict values) |
| 26 |
< |
my @rtraceA = split(' ', "rtrace -ffc -u- -dt .05 -dc .5 -ds .25 -dr 1 -aa .2 -ar 64 -ad 512 -as 128 -lr 7 -lw 1e-03"); |
| 26 |
> |
my @rtraceA = split(' ', "rtrace -u- -dt .05 -dc .5 -ds .25 -dr 1 " . |
| 27 |
> |
"-aa .2 -ar 64 -ad 512 -as 128 -lr 7 -lw 1e-03"); |
| 28 |
|
my @vwraysA = ("vwrays", "-ff", "-pj", ".67"); |
| 29 |
|
my @vwrightA = ("vwright", "-vtv"); |
| 30 |
|
my @rpictA = ("rpict"); |
| 31 |
|
my $outpic; |
| 32 |
+ |
my $outzbf; |
| 33 |
|
OPTION: # sort through options |
| 34 |
|
while ($#ARGV >= 0 && "$ARGV[0]" =~ /^[-\@]/) { |
| 35 |
|
# Check for file inclusion |
| 43 |
|
} |
| 44 |
|
# Check booleans |
| 45 |
|
for my $boopt (@boolO) { |
| 46 |
< |
if ("$ARGV[0]" =~ ('^' . $boopt . '[-+01tfynTFYN]$')) { |
| 46 |
> |
if ("$ARGV[0]" =~ ('^' . $boopt . '[-+01tfynTFYN]?$')) { |
| 47 |
|
push @rtraceA, $ARGV[0]; |
| 48 |
|
push @rpictA, shift(@ARGV); |
| 49 |
|
next OPTION; |
| 84 |
|
if ("$ARGV[0]" eq "-o") { |
| 85 |
|
shift @ARGV; |
| 86 |
|
$outpic = shift(@ARGV); |
| 87 |
+ |
} elsif ("$ARGV[0]" eq "-z") { |
| 88 |
+ |
push @rpictA, shift(@ARGV); |
| 89 |
+ |
$outzbf = $ARGV[0]; |
| 90 |
+ |
push @rpictA, shift(@ARGV); |
| 91 |
|
} elsif ("$ARGV[0]" eq "-n") { |
| 92 |
|
shift @ARGV; |
| 93 |
|
$nprocs = shift(@ARGV); |
| 104 |
|
push(@rpictA, $ARGV[0]) if ($#ARGV == 0); |
| 105 |
|
exec @rpictA ; |
| 106 |
|
} |
| 101 |
– |
die "Need single octree argument\n" if ($#ARGV != 0); |
| 102 |
– |
push @rtraceA, (`@vwraysA -d`); |
| 103 |
– |
chomp $rtraceA[-1]; |
| 107 |
|
push @rtraceA, ("-n", "$nprocs"); |
| 108 |
< |
push @rtraceA, $ARGV[0]; |
| 109 |
< |
my @view = (`@vwrightA 0`); |
| 110 |
< |
exec qq{@vwraysA | @rtraceA | getinfo -a "VIEW=@view"}; |
| 108 |
> |
die "Need single octree argument\n" if ($#ARGV != 0); |
| 109 |
> |
my $oct = $ARGV[0]; |
| 110 |
> |
my $view = `@vwrightA 0`; |
| 111 |
> |
my @res = split(/\s/, `@vwraysA -d`); |
| 112 |
> |
if (defined $outzbf) { # generating depth buffer? |
| 113 |
> |
exec "@vwraysA | @rtraceA -fff -olv @res $oct | " . |
| 114 |
> |
"rsplit -ih -iH -f " . |
| 115 |
> |
"-of $outzbf " . |
| 116 |
> |
"-oh -oH -of3 '!pvalue -r -df' | " . |
| 117 |
> |
"getinfo -a 'VIEW=$view'"; |
| 118 |
> |
} |
| 119 |
> |
# no depth buffer, so simpler |
| 120 |
> |
exec "@vwraysA | @rtraceA -ffc @res $oct | getinfo -a 'VIEW=$view'"; |