45 |
|
q[| sed -n 's/^.* -aa \([.0-9][^ ]*\) .*$/\1/p']; |
46 |
|
my $ambacc=`$cmd`; |
47 |
|
die "Missing -aa setting in header\n" if (! $ambacc ); |
48 |
+ |
die "Zero -aa setting in header\n" if ($ambacc <= .00001); |
49 |
|
$scale *= $ambacc; |
50 |
|
my $ambfmt = ' |
51 |
|
void glow posglow |
56 |
|
posglow sphere position${recno} |
57 |
|
0 |
58 |
|
0 |
59 |
< |
4 ${px} ${py} ${pz} ${psiz} |
59 |
> |
4 ${ px } ${ py } ${ pz } ${ psiz } |
60 |
|
'; |
61 |
|
my $posgradfmt = ' |
62 |
|
void glow arrglow |
68 |
|
0 |
69 |
|
0 |
70 |
|
8 |
71 |
< |
${ cx0 } ${ cy0 } ${ cz0 } |
72 |
< |
${ cx1 } ${ cy1 } ${ cz1 } |
73 |
< |
${ cr0 } 0 |
71 |
> |
${ cx0 } ${ cy0 } ${ cz0 } |
72 |
> |
${ cx1 } ${ cy1 } ${ cz1 } |
73 |
> |
${ cr0 } 0 |
74 |
|
|
75 |
|
void brightfunc pgpat |
76 |
|
2 posfunc ambpos.cal |
91 |
|
0 |
92 |
|
0 |
93 |
|
12 |
94 |
< |
${ px1 } ${ py1 } ${ pz1 } |
95 |
< |
${ px2 } ${ py2 } ${ pz2 } |
96 |
< |
${ px3 } ${ py3 } ${ pz3 } |
97 |
< |
${ px4 } ${ py4 } ${ pz4 } |
94 |
> |
${ px1 } ${ py1 } ${ pz1 } |
95 |
> |
${ px2 } ${ py2 } ${ pz2 } |
96 |
> |
${ px3 } ${ py3 } ${ pz3 } |
97 |
> |
${ px4 } ${ py4 } ${ pz4 } |
98 |
|
'; |
99 |
|
$posgradfmt .= ' |
100 |
|
void glow tipglow |
105 |
|
tipglow sphere atip |
106 |
|
0 |
107 |
|
0 |
108 |
< |
4 ${ cx1 } ${ cy1 } ${ cz1 } ${psiz/7} |
108 |
> |
4 ${ cx1 } ${ cy1 } ${ cz1 } ${psiz/7} |
109 |
|
' if ($dodirgrad); |
110 |
|
my $dirgradfmt=' |
111 |
|
void brightfunc dgpat |
122 |
|
0 |
123 |
|
0 |
124 |
|
8 |
125 |
< |
${ px+dgx*.001 } ${ py+dgy*.001 } ${ pz+dgz*.001 } |
125 |
> |
${ px+dgx/dg*eps*.5 } ${ py+dgy/dg*eps*.5 } ${ pz+dgz/dg*eps*.5 } |
126 |
|
${ dgx } ${ dgy } ${ dgz } |
127 |
< |
0 ${ r0/2 } |
127 |
> |
0 ${ r0/2 } |
128 |
|
|
129 |
|
dgval ring dgdisk${recno}b |
130 |
|
0 |
131 |
|
0 |
132 |
|
8 |
133 |
< |
${ px-dgx*.001 } ${ py-dgy*.001 } ${ pz-dgz*.001 } |
133 |
> |
${ px-dgx/dg*eps*.5 } ${ py-dgy/dg*eps*.5 } ${ pz-dgz/dg*eps*.5 } |
134 |
|
${ -dgx } ${ -dgy } ${ -dgz } |
135 |
< |
0 ${ r0/2 } |
135 |
> |
0 ${ r0/2 } |
136 |
|
'; |
137 |
|
# Load & convert ambient values |
138 |
|
print "# Output produced by: $savedARGV\n"; |