ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/objview.csh
Revision: 2.11
Committed: Fri Nov 21 01:30:17 2008 UTC (15 years, 5 months ago) by greg
Content type: application/x-csh
Branch: MAIN
Changes since 2.10: +7 -2 lines
Log Message:
Added -N option to support multiprocessing in objview

File Contents

# Content
1 #!/bin/csh -f
2 # RCSid: $Id: objview.csh,v 2.10 2005/02/16 05:40:12 greg Exp $
3 #
4 # Make a nice view of an object
5 # Arguments are scene input files
6 #
7 set tmpdir=/tmp
8 set octree=$tmpdir/ov$$.oct
9 set lights=$tmpdir/lt$$.rad
10 set rif=$tmpdir/ov$$.rif
11 set tmpfiles="$octree $lights $rif"
12 set raddev="x11"
13 set up="Z"
14 set vw="XYZ"
15 set rendopts=""
16 set opts=""
17 while ($#argv > 0)
18 switch ($argv[1])
19 case -g*:
20 set usegl
21 breaksw
22 case -u:
23 shift argv
24 set up=$argv[1]
25 breaksw
26 case -s:
27 case -w:
28 set opts=($opts $argv[1])
29 breaksw
30 case -b*:
31 set rendopts=($rendopts -bv)
32 breaksw
33 case -v:
34 shift argv
35 set vw="$argv[1]"
36 breaksw
37 case -N:
38 shift argv
39 set opts=($opts -N $argv[1])
40 set radopt
41 breaksw
42 case -o:
43 shift argv
44 set raddev="$argv[1]"
45 set radopt
46 breaksw
47 case -V:
48 case -e:
49 set opts=($opts $argv[1])
50 set radopt
51 breaksw
52 case -S:
53 set opts=($opts $argv[1])
54 set glradopt
55 breaksw
56 case -*:
57 echo "Bad option: $argv[1]"
58 exit 1
59 default:
60 break
61 endsw
62 shift argv
63 end
64 if ( $#argv == 0 ) then
65 echo "No input files specified"
66 exit 1
67 endif
68 if ( $?usegl ) then
69 if ( $?radopt ) then
70 echo "bad option for glrad"
71 glrad
72 exit 1
73 endif
74 else
75 if ( $?glradopt ) then
76 echo "bad option for rad"
77 rad
78 exit 1
79 endif
80 endif
81
82 onintr quit
83
84 cat > $lights <<_EOF_
85 void glow dim 0 0 4 .1 .1 .15 0
86 dim source background 0 0 4 0 0 1 360
87 void light bright 0 0 3 1000 1000 1000
88 bright source sun1 0 0 4 1 .2 1 5
89 bright source sun2 0 0 4 .3 1 1 5
90 bright source sun3 0 0 4 -1 -.7 1 5
91 _EOF_
92
93 cat > $rif <<_EOF_
94 scene= $argv[*]:q $lights
95 EXPOSURE= .5
96 UP= $up
97 view= $vw
98 OCTREE= $octree
99 oconv= -f
100 render= $rendopts
101 _EOF_
102
103 if ( $?usegl ) then
104 glrad $opts $rif
105 else
106 rad -o $raddev $opts $rif
107 endif
108
109 quit:
110 rm -f $tmpfiles
111 exit 0