--- ray/src/rt/rv3.c 1994/12/22 11:46:19 2.7 +++ ray/src/rt/rv3.c 1995/08/18 10:27:11 2.9 @@ -410,10 +410,14 @@ FVECT vc; nv.horiz = ourview.horiz; nv.vert = ourview.vert; d = sqrt(dist2(ourview.vp, vc)) / mag; - nv.vfore = ourview.vfore + d - d*mag; - if (nv.vfore < 0.0) nv.vfore = 0.0; - nv.vaft = ourview.vaft + d - d*mag; - if (nv.vaft < nv.vfore) nv.vaft = 0.0; + if ((nv.vfore = ourview.vfore) > FTINY) { + nv.vfore += d - d*mag; + if (nv.vfore < 0.0) nv.vfore = 0.0; + } + if ((nv.vaft = ourview.vaft) > FTINY) { + nv.vaft += d - d*mag; + if (nv.vaft <= nv.vfore) nv.vaft = 0.0; + } } for (i = 0; i < 3; i++) nv.vp[i] = vc[i] - d*nv.vdir[i]; @@ -421,15 +425,28 @@ FVECT vc; } -zoomview(vp, zf) /* zoom in our out */ +zoomview(vp, zf) /* zoom in or out */ register VIEW *vp; double zf; { switch (vp->type) { case VT_PAR: /* parallel view */ + vp->horiz /= zf; + vp->vert /= zf; + return; case VT_ANG: /* angular fisheye */ vp->horiz /= zf; + if (vp->horiz > 360.) + vp->horiz = 360.; vp->vert /= zf; + if (vp->vert > 360.) + vp->vert = 360.; + return; + case VT_CYL: /* cylindrical panorama */ + vp->horiz /= zf; + if (vp->horiz > 360.) + vp->horiz = 360.; + vp->vert = atan(tan(vp->vert*(PI/180./2.))/zf) / (PI/180./2.); return; case VT_PER: /* perspective view */ vp->horiz = atan(tan(vp->horiz*(PI/180./2.))/zf) /