265 |
|
|
266 |
|
if (getinterest(s, 0, vc, &mag) < 0) |
267 |
|
return; |
268 |
< |
moveview(0.0, mag, vc); |
268 |
> |
moveview(0.0, 0.0, mag, vc); |
269 |
|
} |
270 |
|
|
271 |
|
|
272 |
|
getrotate(s) /* rotate camera */ |
273 |
|
char *s; |
274 |
|
{ |
275 |
< |
extern double normalize(); |
275 |
> |
extern double normalize(), tan(), atan(); |
276 |
|
VIEW nv; |
277 |
|
FVECT v1; |
278 |
< |
double angle, elev; |
278 |
> |
double angle, elev, zfact; |
279 |
|
|
280 |
< |
elev = 0.0; |
281 |
< |
if (sscanf(s, "%lf %lf", &angle, &elev) < 1) { |
280 |
> |
elev = 0.0; zfact = 1.0; |
281 |
> |
if (sscanf(s, "%lf %lf %lf", &angle, &elev, &zfact) < 1) { |
282 |
|
error(COMMAND, "missing angle"); |
283 |
|
return; |
284 |
|
} |
285 |
– |
nv.type = ourview.type; |
285 |
|
VCOPY(nv.vp, ourview.vp); |
286 |
|
VCOPY(nv.vup, ourview.vup); |
288 |
– |
nv.horiz = ourview.horiz; nv.vert = ourview.vert; |
287 |
|
nv.hresolu = ourview.hresolu; nv.vresolu = ourview.vresolu; |
288 |
|
spinvector(nv.vdir, ourview.vdir, ourview.vup, angle*(PI/180.)); |
289 |
|
if (elev != 0.0) { |
291 |
|
normalize(v1); |
292 |
|
spinvector(nv.vdir, nv.vdir, v1, elev*(PI/180.)); |
293 |
|
} |
294 |
+ |
if ((nv.type = ourview.type) == VT_PAR) { |
295 |
+ |
nv.horiz = ourview.horiz / zfact; |
296 |
+ |
nv.vert = ourview.vert / zfact; |
297 |
+ |
} else { |
298 |
+ |
nv.horiz = atan(tan(ourview.horiz*(PI/180./2.))/zfact) / |
299 |
+ |
(PI/180./2.); |
300 |
+ |
nv.vert = atan(tan(ourview.vert*(PI/180./2.))/zfact) / |
301 |
+ |
(PI/180./2.); |
302 |
+ |
} |
303 |
|
newview(&nv); |
304 |
|
} |
305 |
|
|
308 |
|
register char *s; |
309 |
|
{ |
310 |
|
FVECT vc; |
311 |
< |
double angle, mag; |
311 |
> |
double angle, elev, mag; |
312 |
|
|
313 |
< |
if (sscanf(s, "%lf", &angle) != 1) { |
313 |
> |
elev = 0.0; |
314 |
> |
if (sscanf(s, "%lf %lf", &angle, &elev) < 1) { |
315 |
|
error(COMMAND, "missing angle"); |
316 |
|
return; |
317 |
|
} |
318 |
< |
if (getinterest(sskip(s), 0, vc, &mag) < 0) |
318 |
> |
if (getinterest(sskip(sskip(s)), 0, vc, &mag) < 0) |
319 |
|
return; |
320 |
< |
moveview(angle, mag, vc); |
320 |
> |
moveview(angle, elev, mag, vc); |
321 |
|
} |
322 |
|
|
323 |
|
|