ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/objpict.csh
Revision: 2.6
Committed: Wed Jul 22 17:35:06 2009 UTC (13 years, 4 months ago) by greg
Content type: application/x-csh
Branch: MAIN
Changes since 2.5: +48 -12 lines
Log Message:
Removed dependency on library file "testroom"

File Contents

# Content
1 #!/bin/csh -f
2 # RCSid: $Id: objpict.csh,v 2.5 2008/11/10 19:08:19 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 set xres=250
9 set yres=250
10 set rpict="rpict -av .2 .2 .2 -x $xres -y $yres"
11 set inprad=$tmpdir/op.rad
12 set testroom=$tmpdir/testroom.rad
13 set octree=$tmpdir/op.oct
14 set pict1=$tmpdir/opa.hdr
15 set pict2=$tmpdir/opb.hdr
16 set pict3=$tmpdir/opc.hdr
17 set pict4=$tmpdir/opd.hdr
18 onintr quit
19 if ( $#argv ) then
20 cat $* > $inprad
21 else
22 cat > $inprad
23 endif
24 cat > $testroom << '_EOF_'
25 void plastic wall_mat 0 0 5 .681 .543 .686 0 .2
26 void light bright 0 0 3 3000 3000 3000
27 bright sphere lamp0 0 0 4 4 4 -4 .1
28 bright sphere lamp1 0 0 4 4 0 4 .1
29 bright sphere lamp2 0 0 4 0 4 4 .1
30 wall_mat polygon box.1540 0 0 12
31 5 -5 -5
32 5 -5 5
33 -5 -5 5
34 -5 -5 -5
35 wall_mat polygon box.4620 0 0 12
36 -5 -5 5
37 -5 5 5
38 -5 5 -5
39 -5 -5 -5
40 wall_mat polygon box.2310 0 0 12
41 -5 5 -5
42 5 5 -5
43 5 -5 -5
44 -5 -5 -5
45 wall_mat polygon box.3267 0 0 12
46 5 5 -5
47 -5 5 -5
48 -5 5 5
49 5 5 5
50 wall_mat polygon box.5137 0 0 12
51 5 -5 5
52 5 -5 -5
53 5 5 -5
54 5 5 5
55 wall_mat polygon box.6457 0 0 12
56 -5 5 5
57 -5 -5 5
58 5 -5 5
59 5 5 5
60 '_EOF_'
61 set dims=`getbbox -h $inprad`
62 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]))"`
63 set vw1="-vtl -vp 2 .5 .5 -vd -1 0 0 -vh 1 -vv 1"
64 set vw2="-vtl -vp .5 2 .5 -vd 0 -1 0 -vh 1 -vv 1"
65 set vw3="-vtl -vp .5 .5 2 -vd 0 0 -1 -vu -1 0 0 -vh 1 -vv 1"
66 set vw4="-vp 3 3 3 -vd -1 -1 -1 -vh 20 -vv 20"
67
68 xform -t `ev "-($dims[1]+$dims[2])/2" "-($dims[3]+$dims[4])/2" "-($dims[5]+$dims[6])/2"` \
69 -s `ev 1/$siz` -t .5 .5 .5 $inprad \
70 | oconv $testroom - > $octree
71 $rpict $vw1 $octree > $pict1
72 $rpict $vw2 $octree > $pict2
73 $rpict $vw3 $octree > $pict3
74 $rpict $vw4 $octree > $pict4
75 pcompos $pict3 0 $yres $pict4 $xres $yres $pict1 0 0 $pict2 $xres 0
76
77 quit:
78 rm -r $tmpdir
79 exit 0