260 |
|
} |
261 |
|
|
262 |
|
|
263 |
< |
moveview(angle, mag, vc) /* move viewpoint */ |
264 |
< |
double angle, mag; |
263 |
> |
moveview(angle, elev, mag, vc) /* move viewpoint */ |
264 |
> |
double angle, elev, mag; |
265 |
|
FVECT vc; |
266 |
|
{ |
267 |
|
extern double sqrt(), dist2(); |
268 |
|
double d; |
269 |
< |
FVECT v; |
269 |
> |
FVECT v1; |
270 |
|
VIEW nv; |
271 |
|
register int i; |
272 |
|
|
273 |
|
VCOPY(nv.vup, ourview.vup); |
274 |
|
nv.hresolu = ourview.hresolu; nv.vresolu = ourview.vresolu; |
275 |
|
spinvector(nv.vdir, ourview.vdir, ourview.vup, angle*(PI/180.)); |
276 |
+ |
if (elev != 0.0) { |
277 |
+ |
fcross(v1, ourview.vup, nv.vdir); |
278 |
+ |
normalize(v1); |
279 |
+ |
spinvector(nv.vdir, nv.vdir, v1, elev*(PI/180.)); |
280 |
+ |
} |
281 |
|
if ((nv.type = ourview.type) == VT_PAR) { |
282 |
|
nv.horiz = ourview.horiz / mag; |
283 |
|
nv.vert = ourview.vert / mag; |
284 |
+ |
d = 0.0; /* don't move closer */ |
285 |
|
for (i = 0; i < 3; i++) |
286 |
< |
v[i] = vc[i] - ourview.vp[i]; |
281 |
< |
d = DOT(v, ourview.vdir); /* don't move closer */ |
286 |
> |
d += (vc[i] - ourview.vp[i])*ourview.vdir[i]; |
287 |
|
} else { |
288 |
|
nv.horiz = ourview.horiz; |
289 |
|
nv.vert = ourview.vert; |