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

Comparing ray/src/rt/rv3.c (file contents):
Revision 2.14 by greg, Tue Jan 18 00:33:16 2005 UTC vs.
Revision 2.15 by greg, Fri Jan 21 00:52:59 2005 UTC

# Line 122 | Line 122 | double  *mp;
122                                  VCOPY(vec, thisray.rdir);
123                  else
124                          VCOPY(vec, thisray.rop);
125 <        } else if (direc)
126 <                        for (i = 0; i < 3; i++)
127 <                                vec[i] -= ourview.vp[i];
128 <        if (normalize(vec) == 0.0)
129 <                return(-1);
125 >        } else if (direc) {
126 >                for (i = 0; i < 3; i++)
127 >                        vec[i] -= ourview.vp[i];
128 >                if (normalize(vec) == 0.0) {
129 >                        error(COMMAND, "point at view origin");
130 >                        return(-1);
131 >                }
132 >        }
133          return(0);
134   }
135  
# Line 397 | Line 400 | FVECT  vc;
400                  normalize(v1);
401                  spinvector(nv.vdir, nv.vdir, v1, elev*(PI/180.));
402          }
403 <        if ((nv.type = ourview.type) == VT_PAR) {
404 <                nv.horiz = ourview.horiz / mag;
405 <                nv.vert = ourview.vert / mag;
403 >        if (nv.type == VT_PAR) {
404 >                nv.horiz /= mag;
405 >                nv.vert /= mag;
406                  d = 0.0;                        /* don't move closer */
407                  for (i = 0; i < 3; i++)
408                          d += (vc[i] - ourview.vp[i])*ourview.vdir[i];
409          } else {
410                  d = sqrt(dist2(ourview.vp, vc)) / mag;
411 <                if ((nv.vfore = ourview.vfore) > FTINY) {
411 >                if (nv.vfore > FTINY) {
412                          nv.vfore += d - d*mag;
413                          if (nv.vfore < 0.0) nv.vfore = 0.0;
414                  }
415 <                if ((nv.vaft = ourview.vaft) > FTINY) {
415 >                if (nv.vaft > FTINY) {
416                          nv.vaft += d - d*mag;
417                          if (nv.vaft <= nv.vfore) nv.vaft = 0.0;
418                  }
419 +                nv.vdist += d - d*mag;
420          }
421          for (i = 0; i < 3; i++)
422                  nv.vp[i] = vc[i] - d*nv.vdir[i];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines