ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/genambpos.pl
(Generate patch)

Comparing ray/src/util/genambpos.pl (file contents):
Revision 2.5 by greg, Thu May 1 04:51:12 2014 UTC vs.
Revision 2.11 by greg, Tue Feb 15 04:08:26 2022 UTC

# Line 4 | Line 4
4   # Visualize ambient positions and gradients
5   #
6   use strict;
7 + my $windoz = ($^O eq "MSWin32" or $^O eq "MSWin64");
8 + die "Not supported under Windows -- sorry!\n" if ( $windoz );
9   sub userror {
10          print STDERR "Usage: genambpos [-l lvl][-w minwt][-r rad][-s sf][-p][-d] scene.amb > ambloc.rad\n";
11          exit 1;
# Line 45 | Line 47 | my $cmd = "getinfo < $ARGV[0] " .
47                  q[| sed -n 's/^.* -aa \([.0-9][^ ]*\) .*$/\1/p'];
48   my $ambacc=`$cmd`;
49   die "Missing -aa setting in header\n" if (! $ambacc );
50 + die "Zero -aa setting in header\n" if ($ambacc <= .00001);
51   $scale *= $ambacc;
52   my $ambfmt = '
53   void glow posglow
# Line 55 | Line 58 | void glow posglow
58   posglow sphere position${recno}
59   0
60   0
61 < 4 ${px} ${py} ${pz} ${psiz}
61 > 4 ${  px  } ${  py  } ${  pz  } ${ psiz }
62   ';
63   my $posgradfmt = '
64   void glow arrglow
# Line 67 | Line 70 | arrglow cone pgarrow${recno}
70   0
71   0
72   8
73 <        ${ cx0 }        ${ cy0 }        ${ cz0 }
74 <        ${ cx1 }        ${ cy1 }        ${ cz1 }
75 <        ${ cr0 }        0
73 >        ${    cx0    }  ${    cy0    }  ${    cz0    }
74 >        ${    cx1    }  ${    cy1    }  ${    cz1    }
75 >        ${   cr0   }    0
76  
77   void brightfunc pgpat
78   2 posfunc ambpos.cal
79   0
80   6 ${ px } ${ py } ${ pz } ${ pgx } ${ pgy } ${ pgz }
81  
82 + pgpat colorfunc pgpat
83 + 4 1 if(corralled,.1,1) if(corralled,.1,1) ambpos.cal
84 + 0
85 + 7 ${ px } ${ py } ${ pz } ${  ux  } ${  uy  } ${  uz  } ${   cflags    }
86 +
87   pgpat glow pgval
88   0
89   0
# Line 90 | Line 98 | pgeval polygon pgellipse${recno}
98   0
99   0
100   12
101 <        ${ px1 } ${ py1 } ${ pz1 }
102 <        ${ px2 } ${ py2 } ${ pz2 }
103 <        ${ px3 } ${ py3 } ${ pz3 }
104 <        ${ px4 } ${ py4 } ${ pz4 }
101 >        ${   px1   } ${   py1   } ${   pz1   }
102 >        ${   px2   } ${   py2   } ${   pz2   }
103 >        ${   px3   } ${   py3   } ${   pz3   }
104 >        ${   px4   } ${   py4   } ${   pz4   }
105   ';
106   $posgradfmt .= '
107   void glow tipglow
# Line 101 | Line 109 | void glow tipglow
109   0
110   4 ${2*agr} ${2*agg} ${2*agb} 0
111  
112 < tipglow sphere atip
112 > tipglow sphere atip${recno}
113   0
114   0
115 < 4 ${ cx1 } ${ cy1 } ${ cz1 } ${psiz/7}
115 > 4 ${   cx1   } ${   cy1   } ${   cz1   } ${psiz/7}
116   ' if ($dodirgrad);
117   my $dirgradfmt='
118   void brightfunc dgpat
# Line 121 | Line 129 | dgval ring dgdisk${recno}a
129   0
130   0
131   8
132 <        ${ px+dgx*.001 } ${ py+dgy*.001 } ${ pz+dgz*.001 }
132 >        ${ px+dgx/dg*eps*.5 } ${ py+dgy/dg*eps*.5 } ${ pz+dgz/dg*eps*.5 }
133          ${ dgx } ${ dgy } ${ dgz }
134 <        0       ${ r0/2 }
134 >        0       ${  r0/2  }
135  
136   dgval ring dgdisk${recno}b
137   0
138   0
139   8
140 <        ${ px-dgx*.001 } ${ py-dgy*.001 } ${ pz-dgz*.001 }
140 >        ${ px-dgx/dg*eps*.5 } ${ py-dgy/dg*eps*.5 } ${ pz-dgz/dg*eps*.5 }
141          ${ -dgx } ${ -dgy } ${ -dgz }
142 <        0       ${ r0/2 }
142 >        0       ${  r0/2  }
143   ';
144   # Load & convert ambient values
145   print "# Output produced by: $savedARGV\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines