63 |
|
} |
64 |
|
fputs(progname, fp); |
65 |
|
fprintview(&ourview, fp); |
66 |
+ |
fputs(sskip(s), fp); |
67 |
|
fputs("\n", fp); |
68 |
|
fclose(fp); |
69 |
|
return; |
151 |
|
newview(&nv); |
152 |
|
return; |
153 |
|
} |
154 |
< |
if (oldview.horiz == 0) { /* no old view! */ |
154 |
> |
if (oldview.type == 0) { /* no old view! */ |
155 |
|
error(COMMAND, "no previous view"); |
156 |
|
return; |
157 |
|
} |
171 |
|
|
172 |
|
if (getinterest(s, 1, nv.vdir, &zfact) < 0) |
173 |
|
return; |
174 |
+ |
nv.type = ourview.type; |
175 |
|
VCOPY(nv.vp, ourview.vp); |
176 |
|
VCOPY(nv.vup, ourview.vup); |
177 |
|
nv.hoff = ourview.hoff; nv.voff = ourview.voff; |
178 |
< |
if ((nv.type = ourview.type) == VT_PAR) { |
179 |
< |
nv.horiz = ourview.horiz / zfact; |
178 |
< |
nv.vert = ourview.vert / zfact; |
179 |
< |
} else { |
180 |
< |
nv.horiz = atan(tan(ourview.horiz*(PI/180./2.))/zfact) / |
181 |
< |
(PI/180./2.); |
182 |
< |
nv.vert = atan(tan(ourview.vert*(PI/180./2.))/zfact) / |
183 |
< |
(PI/180./2.); |
184 |
< |
} |
178 |
> |
nv.horiz = ourview.horiz; nv.vert = ourview.vert; |
179 |
> |
zoomview(&nv, zfact); |
180 |
|
newview(&nv); |
181 |
|
} |
182 |
|
|
206 |
|
error(COMMAND, "missing angle"); |
207 |
|
return; |
208 |
|
} |
209 |
+ |
nv.type = ourview.type; |
210 |
|
VCOPY(nv.vp, ourview.vp); |
211 |
|
VCOPY(nv.vup, ourview.vup); |
212 |
|
nv.hoff = ourview.hoff; nv.voff = ourview.voff; |
216 |
|
normalize(v1); |
217 |
|
spinvector(nv.vdir, nv.vdir, v1, elev*(PI/180.)); |
218 |
|
} |
219 |
< |
if ((nv.type = ourview.type) == VT_PAR) { |
220 |
< |
nv.horiz = ourview.horiz / zfact; |
225 |
< |
nv.vert = ourview.vert / zfact; |
226 |
< |
} else { |
227 |
< |
nv.horiz = atan(tan(ourview.horiz*(PI/180./2.))/zfact) / |
228 |
< |
(PI/180./2.); |
229 |
< |
nv.vert = atan(tan(ourview.vert*(PI/180./2.))/zfact) / |
230 |
< |
(PI/180./2.); |
231 |
< |
} |
219 |
> |
nv.horiz = ourview.horiz; nv.vert = ourview.vert; |
220 |
> |
zoomview(&nv, zfact); |
221 |
|
newview(&nv); |
222 |
|
} |
223 |
|
|
529 |
|
if ((*dev->getcur)(&x, &y) == ABORT) |
530 |
|
return; |
531 |
|
|
532 |
< |
viewray(thisray.rorg, thisray.rdir, &ourview, |
533 |
< |
(x+.5)/hresolu, (y+.5)/vresolu); |
534 |
< |
|
532 |
> |
if (viewray(thisray.rorg, thisray.rdir, &ourview, |
533 |
> |
(x+.5)/hresolu, (y+.5)/vresolu) < 0) { |
534 |
> |
error(COMMAND, "not on image"); |
535 |
> |
return; |
536 |
> |
} |
537 |
> |
|
538 |
|
} else if (normalize(thisray.rdir) == 0.0) { |
539 |
|
error(COMMAND, "zero ray direction"); |
540 |
|
return; |