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

Comparing ray/src/common/image.c (file contents):
Revision 2.46 by greg, Fri Apr 27 05:00:29 2018 UTC vs.
Revision 2.47 by greg, Fri Apr 27 17:36:01 2018 UTC

# Line 245 | Line 245 | FVECT  p
245                  break;
246          case VT_PER:                    /* perspective view */
247                  d = DOT(disp,v->vdir);
248 <                if ((v->vaft > FTINY) & (d > v->vaft))
248 >                if ((v->vaft > FTINY) & (d >= v->vaft))
249                          rflags |= VL_BEYOND;
250                  ip[2] = VLEN(disp);
251                  if (d < -FTINY) {       /* fold pyramid */
# Line 275 | Line 275 | FVECT  p
275                  d = d*d + d2*d2;
276                  if (d <= FTINY*FTINY)
277                          return(VL_BAD); /* at pole */
278 <                if ((v->vaft > FTINY) & (d > v->vaft*v->vaft))
278 >                if ((v->vaft > FTINY) & (d >= v->vaft*v->vaft))
279                          rflags |= VL_BEYOND;
280                  d = 1.0/sqrt(d);
281                  ip[1] = DOT(disp,v->vvec)*d/v->vn2 + 0.5 - v->voff;
# Line 315 | Line 315 | FVECT  p
315          ip[0] = DOT(disp,v->hvec)/v->hn2 + 0.5 - v->hoff;
316          ip[1] = DOT(disp,v->vvec)/v->vn2 + 0.5 - v->voff;
317   gotall:                                 /* add appropriate return flags */
318 <        rflags |= VL_BEHIND*(ip[2] <= 0.0);
318 >        if (!(rflags & (VL_BEHIND|VL_BEYOND)))
319 >                rflags |= (ip[2] <= 0.0) ? VL_BEHIND :
320 >                                          VL_BEYOND * ((v->vaft > FTINY) &
321 >                                                (ip[2] >= v->vaft - v->vfore));
322          rflags |= VL_OUTSIDE*((0.0 >= ip[0]) | (ip[0] >= 1.0) |
323                                  (0.0 >= ip[1]) | (ip[1] >= 1.0));
321        if ((v->vaft > FTINY) & !(rflags & (VL_BEHIND|VL_BEYOND)))
322                rflags |= VL_BEYOND*(ip[2] > v->vaft - v->vfore);
324          return(rflags);
325   }
326  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines