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.1 by gregl, Wed Jul 9 12:18:03 1997 UTC vs.
Revision 3.3 by gregl, Fri Oct 17 10:42:45 1997 UTC

# Line 124 | Line 124 | char   *argv[];
124          if (i == argc)
125                  normaspect(viewaspect(&vw), &pa, &rs.xr, &rs.yr);
126          if (getdim) {
127 <                printf("-x %d -y %d\n", rs.xr, rs.yr);
127 >                printf("-x %d -y %d -ld%c\n", rs.xr, rs.yr,
128 >                                vw.vaft > FTINY ? '+' : '-');
129                  exit(0);
130          }
131          putrays();
# Line 139 | Line 140 | userr:
140  
141   putrays()
142   {
143 +        static FLOAT    loc[2];
144 +        static FVECT    rorg, rdir;
145          float   *zbuf;
146          int     sc;
147 <        FLOAT   loc[2];
145 <        FVECT   rorg, rdir;
147 >        double  d;
148          register int    si, i;
149  
150          if (zfd >= 0) {
# Line 163 | Line 165 | putrays()
165                  }
166                  for (si = 0; si < scanlen(&rs); si++) {
167                          pix2loc(loc, &rs, si, sc);
168 <                        if (viewray(rorg, rdir, &vw, loc[0], loc[1]) < -FTINY)
168 >                        d = viewray(rorg, rdir, &vw, loc[0], loc[1]);
169 >                        if (d < -FTINY)
170                                  rorg[0] = rorg[1] = rorg[2] =
171                                  rdir[0] = rdir[1] = rdir[2] = 0.;
172                          else if (zfd >= 0)
# Line 171 | Line 174 | putrays()
174                                          rorg[i] += rdir[i]*zbuf[si];
175                                          rdir[i] = -rdir[i];
176                                  }
177 +                        else if (d > FTINY) {
178 +                                rdir[0] *= d; rdir[1] *= d; rdir[2] *= d;
179 +                        }
180                          (*putr)(rorg, rdir);
181                  }
182          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines