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.12 by greg, Wed Jan 17 10:55:40 1996 UTC vs.
Revision 2.13 by gregl, Tue Dec 9 16:41:03 1997 UTC

# Line 205 | Line 205 | FVECT  ip;
205   register VIEW  *v;
206   FVECT  p;
207   {
208 <        double  d;
208 >        double  d, d2;
209          FVECT  disp;
210  
211          disp[0] = p[0] - v->vp[0];
# Line 218 | Line 218 | FVECT  p;
218                  break;
219          case VT_PER:                    /* perspective view */
220                  d = DOT(disp,v->vdir);
221 <                ip[2] = sqrt(DOT(disp,disp));
221 >                ip[2] = VLEN(disp);
222                  if (d < 0.0) {          /* fold pyramid */
223                          ip[2] = -ip[2];
224                          d = -d;
# Line 240 | Line 240 | FVECT  p;
240                  ip[2] -= v->vfore;
241                  break;
242          case VT_CYL:                    /* cylindrical panorama */
243                ip[2] = DOT(disp,v->vdir);
243                  d = DOT(disp,v->hvec);
244 <                ip[0] = 180.0/PI * atan2(d,ip[2]) / v->horiz + 0.5 - v->hoff;
245 <                ip[1] = DOT(disp,v->vvec)/v->vn2 + 0.5 - v->voff;
244 >                d2 = DOT(disp,v->vdir);
245 >                ip[0] = 180.0/PI * atan2(d,d2) / v->horiz + 0.5 - v->hoff;
246 >                d = 1.0/sqrt(d*d + d2*d2);
247 >                ip[1] = DOT(disp,v->vvec)*d/v->vn2 + 0.5 - v->voff;
248 >                ip[2] = VLEN(disp);
249                  if (v->vfore > FTINY)
250 <                        ip[2] = sqrt(DOT(disp,disp)) *
249 <                                (1.0 - v->vfore/sqrt(d*d + ip[2]*ip[2]));
250 <                else
251 <                        ip[2] = sqrt(DOT(disp,disp));
250 >                        ip[2] *= (1.0 - v->vfore*d);
251                  return;
252          case VT_ANG:                    /* angular fisheye */
253                  ip[0] = 0.5 - v->hoff;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines