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.12 by greg, Sat Oct 13 20:56:01 1990 UTC vs.
Revision 1.13 by greg, Mon Oct 15 14:17:05 1990 UTC

# Line 71 | Line 71 | register VIEW  *v;
71          default:
72                  return("unknown view type");
73          }
74 <        if (v->type == VT_PAR || v->type == VT_PER) {
74 >        if (v->type != VT_ANG) {
75                  v->hvec[0] *= v->hn2;
76                  v->hvec[1] *= v->hn2;
77                  v->hvec[2] *= v->hn2;
# Line 125 | Line 125 | double  x, y;
125                  normalize(direc);
126                  return(0);
127          case VT_HEM:                    /* hemispherical fisheye */
128 <                x *= v->horiz/90.0;
129 <                y *= v->vert/90.0;
130 <                z = 1.0 - x*x - y*y;
128 >                z = 1.0 - x*x*v->hn2 - y*y*v->vn2;
129                  if (z < 0.0)
130                          return(-1);
131                  z = sqrt(z);
# Line 177 | Line 175 | FVECT  p;
175          case VT_PAR:                    /* parallel view */
176                  if (zp != NULL)
177                          *zp = DOT(disp,v->vdir);
178 <                *xp = DOT(disp,v->hvec)/v->hn2 + 0.5 - v->hoff;
181 <                *yp = DOT(disp,v->vvec)/v->vn2 + 0.5 - v->voff;
182 <                return;
178 >                break;
179          case VT_PER:                    /* perspective view */
180                  d = DOT(disp,v->vdir);
181                  if (zp != NULL) {
# Line 195 | Line 191 | FVECT  p;
191                          disp[1] *= d;
192                          disp[2] *= d;
193                  }
194 <                *xp = DOT(disp,v->hvec)/v->hn2 + 0.5 - v->hoff;
199 <                *yp = DOT(disp,v->vvec)/v->vn2 + 0.5 - v->voff;
200 <                return;
194 >                break;
195          case VT_HEM:                    /* hemispherical fisheye */
196                  d = normalize(disp);
197                  if (zp != NULL) {
# Line 206 | Line 200 | FVECT  p;
200                          else
201                                  *zp = d;
202                  }
203 <                *xp = DOT(disp,v->hvec)*90.0/v->horiz + 0.5 - v->hoff;
210 <                *yp = DOT(disp,v->vvec)*90.0/v->vert + 0.5 - v->voff;
211 <                return;
203 >                break;
204          case VT_ANG:                    /* angular fisheye */
205                  d = normalize(disp);
206                  if (zp != NULL)
# Line 228 | Line 220 | FVECT  p;
220                  *yp += DOT(disp,v->vvec)*d*180.0/v->vert;
221                  return;
222          }
223 +        *xp = DOT(disp,v->hvec)/v->hn2 + 0.5 - v->hoff;
224 +        *yp = DOT(disp,v->vvec)/v->vn2 + 0.5 - v->voff;
225   }
226  
227  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines