139 |
|
|
140 |
|
putrays() |
141 |
|
{ |
142 |
+ |
static FLOAT loc[2]; |
143 |
+ |
static FVECT rorg, rdir; |
144 |
|
float *zbuf; |
145 |
|
int sc; |
146 |
< |
FLOAT loc[2]; |
145 |
< |
FVECT rorg, rdir; |
146 |
> |
double d; |
147 |
|
register int si, i; |
148 |
|
|
149 |
|
if (zfd >= 0) { |
164 |
|
} |
165 |
|
for (si = 0; si < scanlen(&rs); si++) { |
166 |
|
pix2loc(loc, &rs, si, sc); |
167 |
< |
if (viewray(rorg, rdir, &vw, loc[0], loc[1]) < -FTINY) |
167 |
> |
d = viewray(rorg, rdir, &vw, loc[0], loc[1]); |
168 |
> |
if (d < -FTINY) |
169 |
|
rorg[0] = rorg[1] = rorg[2] = |
170 |
|
rdir[0] = rdir[1] = rdir[2] = 0.; |
171 |
|
else if (zfd >= 0) |
173 |
|
rorg[i] += rdir[i]*zbuf[si]; |
174 |
|
rdir[i] = -rdir[i]; |
175 |
|
} |
176 |
+ |
else if (d > FTINY) { |
177 |
+ |
rdir[0] *= d; rdir[1] *= d; rdir[2] *= d; |
178 |
+ |
} |
179 |
|
(*putr)(rorg, rdir); |
180 |
|
} |
181 |
|
} |