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 1.10 by greg, Thu Sep 13 08:34:15 1990 UTC vs.
Revision 1.11 by greg, Fri Sep 21 17:06:31 1990 UTC

# Line 119 | Line 119 | FVECT  p;
119                  if (zp != NULL)
120                          *zp = DOT(disp,v->vdir);
121          } else {                        /* perspective view */
122 <                d = 1.0/DOT(disp,v->vdir);
122 >                d = DOT(disp,v->vdir);
123                  if (zp != NULL) {
124                          *zp = sqrt(DOT(disp,disp));
125                          if (d < 0.0)
126                                  *zp = -*zp;
127                  }
128 <                disp[0] *= d;
129 <                disp[1] *= d;
130 <                disp[2] *= d;
128 >                if (d < 0.0)            /* fold pyramid */
129 >                        d = -d;
130 >                if (d > FTINY) {
131 >                        d = 1.0/d;
132 >                        disp[0] *= d;
133 >                        disp[1] *= d;
134 >                        disp[2] *= d;
135 >                }
136          }
137          *xp = DOT(disp,v->hvec)/v->hn2 + 0.5 - v->hoff;
138          *yp = DOT(disp,v->vvec)/v->vn2 + 0.5 - v->voff;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines