bin/ltpict.pl
author Axel Jacobs <axel@jaloxa.eu>
Thu, 30 Jan 2014 21:54:21 +0000
changeset 55 e00e7d28865e
parent 54 be2807ee7183
child 56 259ce6d95331
permissions -rwxr-xr-x
ltpict: Change default scale factor.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
54
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     1
#!/usr/bin/perl
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     2
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     3
# Make a nice multi-view picture of a luminaire
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     4
#
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     5
# This is based on objpict.pl that renders four-view
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     6
# images of objects that are not light sources.
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     7
#
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     8
# Written by Axel Jacobs,
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     9
#   with input from Rob Guglielmetti and Gre
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    10
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    11
use strict;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    12
use warnings;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    13
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    14
use File::Temp qw/ tempdir /;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    15
#my $td = tempdir( CLEANUP => 1 );
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    16
my $td = "tmp";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    17
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    18
#my $xres = 1024;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    19
#my $yres = 1024;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    20
my $xres = 600;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    21
my $yres = 600;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    22
my $tiny = 0.01;
55
e00e7d28865e ltpict: Change default scale factor.
Axel Jacobs <axel@jaloxa.eu>
parents: 54
diff changeset
    23
my $is_ies = 0;
54
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    24
my $rpict_cmd = "rpict -ab 0 -ds 0 -dv -av 0 0 0 -x $xres -y $yres";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    25
my $pfilt_cmd = "pfilt -r .6 -x /2 -y /2";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    26
55
e00e7d28865e ltpict: Change default scale factor.
Axel Jacobs <axel@jaloxa.eu>
parents: 54
diff changeset
    27
my $ies = "$td/dist.ies";
e00e7d28865e ltpict: Change default scale factor.
Axel Jacobs <axel@jaloxa.eu>
parents: 54
diff changeset
    28
my $fittings = "$td/fitting.rad";
54
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    29
my $material = "$td/lt.mat";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    30
my $testroom1 = "$td/testroom1.rad";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    31
my $testroom2 = "$td/testroom2.rad";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    32
my $testroom3 = "$td/testroom3.rad";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    33
my $testroom4 = "$td/testroom4.rad";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    34
my $octree1 = "$td/lt1.oct";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    35
my $octree2 = "$td/lt2.oct";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    36
my $octree3 = "$td/lt3.oct";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    37
my $octree4 = "$td/lt4.oct";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    38
55
e00e7d28865e ltpict: Change default scale factor.
Axel Jacobs <axel@jaloxa.eu>
parents: 54
diff changeset
    39
# Parse command line arguments
e00e7d28865e ltpict: Change default scale factor.
Axel Jacobs <axel@jaloxa.eu>
parents: 54
diff changeset
    40
if ("$ARGV[0]" eq '-i') {    # File is an IES file, not Radiance luminaire
e00e7d28865e ltpict: Change default scale factor.
Axel Jacobs <axel@jaloxa.eu>
parents: 54
diff changeset
    41
	$is_ies = 1;
e00e7d28865e ltpict: Change default scale factor.
Axel Jacobs <axel@jaloxa.eu>
parents: 54
diff changeset
    42
	shift @ARGV;
e00e7d28865e ltpict: Change default scale factor.
Axel Jacobs <axel@jaloxa.eu>
parents: 54
diff changeset
    43
}
54
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    44
# We need at least one Radiance file or a scene on STDIN (but not both)
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    45
if ($#ARGV < 0) {
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    46
	open(FH, ">$td/stdin.rad") or 
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    47
			die("objview: Can't write to temporary file $td/stdin.rad\n");
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    48
	while (<>) {
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    49
		print FH;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    50
	}
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    51
	# Pretend stdin.rad was passed as argument.
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    52
	@ARGV = ("$td/stdin.rad");
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    53
}
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    54
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    55
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    56
# Scale fitting and center at origin
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    57
my $dimstr = `getbbox -h @ARGV`;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    58
chomp $dimstr;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    59
# Values returned by getbbox are indented and delimited with multiple spaces.
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    60
$dimstr =~ s/^\s+//;   # remove leading spaces
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    61
my @dims = split(/\s+/, $dimstr);   # convert to array
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    62
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    63
# Find largest axes-aligned dimension
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    64
my @diffs = ($dims[1]-$dims[0], $dims[3]-$dims[2], $dims[5]-$dims[4]);
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    65
@diffs = reverse sort { $a <=> $b } @diffs;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    66
my $size = $diffs[0];
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    67
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    68
# Move fitting so centre is at origin
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    69
my $xtrans = -1.0 * ($dims[0] + $dims[1]) / 2;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    70
my $ytrans = -1.0 * ($dims[2] + $dims[3]) / 2;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    71
my $ztrans = -1.0 * ($dims[4] + $dims[5]) / 2;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    72
# Scale so that largest object dimension is unity
55
e00e7d28865e ltpict: Change default scale factor.
Axel Jacobs <axel@jaloxa.eu>
parents: 54
diff changeset
    73
my $scale = 0.001 / $size;
54
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    74
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    75
my $fitting = "$td/fitting.rad";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    76
open(FH, ">$fitting") or
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    77
		die("Can\'t write to temporary file $fitting");
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    78
print FH "!xform -t $xtrans $ytrans $ztrans -s $scale @ARGV";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    79
close FH;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    80
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    81
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    82
# Material for the room
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    83
open(FH, ">$material") or
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    84
		die("Can\'t write to temporary file $material");
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    85
print FH "void plastic wall_mat  0  0  5  .5 .5 .5  0 0";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    86
close FH;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    87
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    88
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    89
# Different 'room' geometry for different views
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    90
my $OFFSET = 0.1;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    91
open(FH, ">$testroom1") or die("Can\'t write to temporary file $testroom1");
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    92
# C0-C180
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    93
print FH "wall_mat polygon box.4620  0  0  12  -$OFFSET -5 5  -$OFFSET 5 5  -$OFFSET 5 -5  -$OFFSET -5 -5";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    94
close(FH);
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    95
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    96
open(FH, ">$testroom2") or die("Can\'t write to temporary file $testroom2");
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    97
# C90-C270
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    98
print FH "wall_mat polygon box.1540  0  0  12  5 $OFFSET -5  5 $OFFSET 5  -5 $OFFSET 5  -5 $OFFSET -5";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    99
close(FH);
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   100
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   101
open(FH, ">$testroom3") or die("Can\'t write to temporary file $testroom3");
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   102
# Lower hemisphere
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   103
print FH "wall_mat bubble lower  0  0  4 0 0 $dims[4] 5";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   104
close(FH);
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   105
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   106
open(FH, ">$testroom4") or die("Can\'t write to temporary file $testroom4");
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   107
# Upper hemisphere
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   108
print FH "wall_mat bubble upper  0  0  4 0 0 $dims[5] 5";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   109
close(FH);
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   110
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   111
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   112
# Get bbox again, for the translated and scaled fitting.
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   113
$dimstr = `getbbox -h $fitting`;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   114
chomp $dimstr;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   115
# Values returned by getbbox are indented and delimited with multiple spaces.
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   116
$dimstr =~ s/^\s+//;   # remove leading spaces
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   117
@dims = split(/\s+/, $dimstr);   # convert to array
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   118
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   119
# Define the four views
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   120
my $vw1 = "-vtl -vp 4.5 0 0 -vd -1 0 0 -vh 10 -vv 10";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   121
my $vw2 = "-vtl -vp 0 -4.5 0 -vd 0 1 0 -vh 10 -vv 10";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   122
my $zcent3 = $dims[4] - $tiny;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   123
my $vw3 = "-vta -vp 0 0 $zcent3 -vd 0 0 -1 -vu 0 1 0 -vh 180 -vv 180";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   124
my $zcent4 = $dims[5] + $tiny;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   125
my $vw4 = "-vta -vp 0 0 $zcent4 -vd 0 0 1 -vu 0 1 0 -vh 180 -vv 180";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   126
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   127
system "oconv $material $testroom1 $fitting > $octree1";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   128
system "oconv $material $testroom2 $fitting > $octree2";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   129
system "oconv $material $testroom3 $fitting > $octree3";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   130
system "oconv $material $testroom4 $fitting > $octree4";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   131
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   132
# Render four different views of the objects
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   133
system "$rpict_cmd $vw1 $octree1 > $td/right.hdr";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   134
system "$rpict_cmd $vw2 $octree2 > $td/front.hdr";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   135
system "$rpict_cmd $vw3 $octree3 > $td/down.hdr";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   136
system "$rpict_cmd $vw4 $octree4 > $td/up.hdr";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   137
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   138
# Compose the four views into one image
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   139
my $cmd;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   140
my $vtl = "$td/vtl.hdr";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   141
my $vta = "$td/vta.hdr";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   142
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   143
# Auto-expose right/front and down/up pairs separately
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   144
system "pcompos $td/right.hdr 0 0 $td/front.hdr $xres 0 |$pfilt_cmd > $vtl";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   145
system "pcompos $td/down.hdr 0 0 $td/up.hdr $xres 0 |$pfilt_cmd > $vta";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   146
my $yres2 = $yres / 2;
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   147
exec "pcompos $vtl 0 0 $vta 0 $yres2";
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   148
be2807ee7183 Working prototype of ltpict.pl
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   149
#EOF