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

Comparing ray/src/util/vwrays.c (file contents):
Revision 3.21 by greg, Fri Jun 12 22:45:20 2020 UTC vs.
Revision 3.22 by greg, Fri Dec 3 17:22:28 2021 UTC

# Line 186 | Line 186 | pix2rays(
186          RREAL   loc[2];
187          int     pp[2];
188          double  d;
189 <        int     i;
189 >        int     i, c;
190  
191          while (fscanf(fp, "%lf %lf", &px, &py) == 2) {
192                  px += .5; py += .5;
# Line 209 | Line 209 | pix2rays(
209                                  exit(1);
210                          }
211                  }
212 <                jitterloc(loc);
213 <                d = viewray(rorg, rdir, &vw, loc[0], loc[1]);
214 <                if (d < -FTINY)
215 <                        rorg[0] = rorg[1] = rorg[2] =
216 <                        rdir[0] = rdir[1] = rdir[2] = 0.;
217 <                else if (zfd >= 0)
218 <                        for (i = 0; i < 3; i++) {
219 <                                rorg[i] += rdir[i]*zval;
220 <                                rdir[i] = -rdir[i];
212 >                for (c = repeatcnt; c-- > 0; ) {
213 >                        jitterloc(loc);
214 >                        d = viewray(rorg, rdir, &vw, loc[0], loc[1]);
215 >                        if (d < -FTINY)
216 >                                rorg[0] = rorg[1] = rorg[2] =
217 >                                rdir[0] = rdir[1] = rdir[2] = 0.;
218 >                        else if (zfd >= 0)
219 >                                for (i = 0; i < 3; i++) {
220 >                                        rorg[i] += rdir[i]*zval;
221 >                                        rdir[i] = -rdir[i];
222 >                                }
223 >                        else if (d > FTINY) {
224 >                                rdir[0] *= d; rdir[1] *= d; rdir[2] *= d;
225                          }
226 <                else if (d > FTINY) {
227 <                        rdir[0] *= d; rdir[1] *= d; rdir[2] *= d;
226 >                        (*putr)(rorg, rdir);
227 >                        if (c) {
228 >                                loc[0] = px/rs.xr; loc[1] = py/rs.yr;
229 >                        }
230                  }
225                (*putr)(rorg, rdir);
231                  if (unbuffered)
232                          fflush(stdout);
233          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines