266 |
|
{ |
267 |
|
extern double sqrt(), dist2(); |
268 |
|
double d; |
269 |
+ |
FVECT v; |
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.)); |
275 |
– |
d = sqrt(dist2(ourview.vp, vc)) / mag; |
276 |
– |
for (i = 0; i < 3; i++) |
277 |
– |
nv.vp[i] = vc[i] - d*nv.vdir[i]; |
276 |
|
if ((nv.type = ourview.type) == VT_PAR) { |
277 |
|
nv.horiz = ourview.horiz / mag; |
278 |
|
nv.vert = ourview.vert / mag; |
279 |
+ |
for (i = 0; i < 3; i++) |
280 |
+ |
v[i] = vc[i] - ourview.vp[i]; |
281 |
+ |
d = DOT(v, ourview.vdir); /* don't move closer */ |
282 |
|
} else { |
283 |
|
nv.horiz = ourview.horiz; |
284 |
|
nv.vert = ourview.vert; |
285 |
+ |
d = sqrt(dist2(ourview.vp, vc)) / mag; |
286 |
|
} |
287 |
+ |
for (i = 0; i < 3; i++) |
288 |
+ |
nv.vp[i] = vc[i] - d*nv.vdir[i]; |
289 |
|
newview(&nv); |
290 |
|
} |
291 |
|
|