ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/objview.csh
Revision: 2.6
Committed: Wed Jun 10 17:50:49 1998 UTC (25 years, 9 months ago) by gwlarson
Content type: application/x-csh
Branch: MAIN
Changes since 2.5: +80 -8 lines
Log Message:
changed to use rad and glrad for rendering

File Contents

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