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