orig/objpict.csh
author Axel Jacobs <axel@jaloxa.eu>
Mon, 14 Apr 2014 22:21:17 +0100
changeset 73 87fa3132a136
parent 0 0aa115157c9c
permissions -rw-r--r--
New IES test file with spaces in file name
axel@0
     1
#!/bin/csh -f
axel@0
     2
# RCSid: $Id: objpict.csh,v 2.7 2009/07/22 17:48:07 greg Exp $
axel@0
     3
#
axel@0
     4
# Make a nice multi-view picture of an object
axel@0
     5
# Command line arguments contain materials and object files
axel@0
     6
#
axel@0
     7
set tmpdir=/tmp/objv$$
axel@0
     8
mkdir $tmpdir
axel@0
     9
set xres=1024
axel@0
    10
set yres=1024
axel@0
    11
set rpict="rpict -av .2 .2 .2 -x $xres -y $yres"
axel@0
    12
set inprad=op$$.rad
axel@0
    13
set testroom=$tmpdir/testroom.rad
axel@0
    14
set octree=$tmpdir/op.oct
axel@0
    15
onintr quit
axel@0
    16
if ( $#argv ) then
axel@0
    17
	cat $* > $inprad
axel@0
    18
else
axel@0
    19
	cat > $inprad
axel@0
    20
endif
axel@0
    21
cat > $testroom << '_EOF_'
axel@0
    22
void plastic wall_mat 0 0 5 .681 .543 .686 0 .2
axel@0
    23
void light bright 0 0 3 3000 3000 3000
axel@0
    24
bright sphere lamp0 0 0 4 4 4 -4 .1
axel@0
    25
bright sphere lamp1 0 0 4 4 0 4 .1
axel@0
    26
bright sphere lamp2 0 0 4 0 4 4 .1
axel@0
    27
wall_mat polygon box.1540 0 0 12
axel@0
    28
                  5                 -5                 -5
axel@0
    29
                  5                 -5                  5
axel@0
    30
                 -5                 -5                  5
axel@0
    31
                 -5                 -5                 -5
axel@0
    32
wall_mat polygon box.4620 0 0 12
axel@0
    33
                 -5                 -5                  5
axel@0
    34
                 -5                  5                  5
axel@0
    35
                 -5                  5                 -5
axel@0
    36
                 -5                 -5                 -5
axel@0
    37
wall_mat polygon box.2310 0 0 12
axel@0
    38
                 -5                  5                 -5
axel@0
    39
                  5                  5                 -5
axel@0
    40
                  5                 -5                 -5
axel@0
    41
                 -5                 -5                 -5
axel@0
    42
wall_mat polygon box.3267 0 0 12
axel@0
    43
                  5                  5                 -5
axel@0
    44
                 -5                  5                 -5
axel@0
    45
                 -5                  5                  5
axel@0
    46
                  5                  5                  5
axel@0
    47
wall_mat polygon box.5137 0 0 12
axel@0
    48
                  5                 -5                  5
axel@0
    49
                  5                 -5                 -5
axel@0
    50
                  5                  5                 -5
axel@0
    51
                  5                  5                  5
axel@0
    52
wall_mat polygon box.6457 0 0 12
axel@0
    53
                 -5                  5                  5
axel@0
    54
                 -5                 -5                  5
axel@0
    55
                  5                 -5                  5
axel@0
    56
                  5                  5                  5
axel@0
    57
'_EOF_'
axel@0
    58
set dims=`getbbox -h $inprad`
axel@0
    59
set siz=`rcalc -n -e 'max(a,b):if(a-b,a,b);$1='"max($dims[2]-$dims[1],max($dims[4]-$dims[3],$dims[6]-$dims[5]))"`
axel@0
    60
set vw1="-vtl -vp 2 .5 .5 -vd -1 0 0 -vh 1 -vv 1"
axel@0
    61
set vw2="-vtl -vp .5 2 .5 -vd 0 -1 0 -vh 1 -vv 1"
axel@0
    62
set vw3="-vtl -vp .5 .5 2 -vd 0 0 -1 -vu -1 0 0 -vh 1 -vv 1"
axel@0
    63
set vw4="-vp 3 3 3 -vd -1 -1 -1 -vh 20 -vv 20"
axel@0
    64
axel@0
    65
xform -t `ev "-($dims[1]+$dims[2])/2" "-($dims[3]+$dims[4])/2" "-($dims[5]+$dims[6])/2"` \
axel@0
    66
		-s `ev 1/$siz` -t .5 .5 .5 $inprad \
axel@0
    67
	| oconv $testroom - > $octree
axel@0
    68
pcompos "\!$rpict $vw3 $octree" 0 $yres \
axel@0
    69
	"\!$rpict $vw4 $octree" $xres $yres \
axel@0
    70
	"\!$rpict $vw1 $octree" 0 0 \
axel@0
    71
	"\!$rpict $vw2 $octree" $xres 0 \
axel@0
    72
	| pfilt -1 -r .6 -x /2 -y /2
axel@0
    73
axel@0
    74
quit:
axel@0
    75
rm -r $tmpdir $inprad
axel@0
    76
exit 0