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