68 |
|
char buf[128]; |
69 |
|
char *fname; |
70 |
|
int change = 0; |
71 |
< |
VIEW nv; |
71 |
> |
VIEW nv = ourview; |
72 |
|
|
73 |
|
while (isspace(*s)) |
74 |
|
s++; |
75 |
|
if (*s == '-') { /* command line parameters */ |
76 |
– |
nv = ourview; |
76 |
|
if (sscanview(&nv, s)) |
77 |
|
newview(&nv); |
78 |
|
else |
100 |
|
if (buf[0] && buf[0] != ourview.type) { |
101 |
|
nv.type = buf[0]; |
102 |
|
change++; |
103 |
< |
} else |
105 |
< |
nv.type = ourview.type; |
103 |
> |
} |
104 |
|
sprintf(buf, "view point (%.6g %.6g %.6g): ", |
105 |
|
ourview.vp[0], ourview.vp[1], ourview.vp[2]); |
106 |
|
(*dev->comout)(buf); |
108 |
|
if (buf[0] == CTRL('C')) return; |
109 |
|
if (sscanvec(buf, nv.vp)) |
110 |
|
change++; |
113 |
– |
else |
114 |
– |
VCOPY(nv.vp, ourview.vp); |
111 |
|
sprintf(buf, "view direction (%.6g %.6g %.6g): ", |
112 |
|
ourview.vdir[0], ourview.vdir[1], ourview.vdir[2]); |
113 |
|
(*dev->comout)(buf); |
115 |
|
if (buf[0] == CTRL('C')) return; |
116 |
|
if (sscanvec(buf, nv.vdir)) |
117 |
|
change++; |
122 |
– |
else |
123 |
– |
VCOPY(nv.vdir, ourview.vdir); |
118 |
|
sprintf(buf, "view up (%.6g %.6g %.6g): ", |
119 |
|
ourview.vup[0], ourview.vup[1], ourview.vup[2]); |
120 |
|
(*dev->comout)(buf); |
122 |
|
if (buf[0] == CTRL('C')) return; |
123 |
|
if (sscanvec(buf, nv.vup)) |
124 |
|
change++; |
131 |
– |
else |
132 |
– |
VCOPY(nv.vup, ourview.vup); |
125 |
|
sprintf(buf, "view horiz and vert size (%.6g %.6g): ", |
126 |
|
ourview.horiz, ourview.vert); |
127 |
|
(*dev->comout)(buf); |
129 |
|
if (buf[0] == CTRL('C')) return; |
130 |
|
if (sscanf(buf, "%lf %lf", &nv.horiz, &nv.vert) == 2) |
131 |
|
change++; |
140 |
– |
else { |
141 |
– |
nv.horiz = ourview.horiz; nv.vert = ourview.vert; |
142 |
– |
} |
132 |
|
sprintf(buf, "fore and aft clipping plane (%.6g %.6g): ", |
133 |
|
ourview.vfore, ourview.vaft); |
134 |
|
(*dev->comout)(buf); |
136 |
|
if (buf[0] == CTRL('C')) return; |
137 |
|
if (sscanf(buf, "%lf %lf", &nv.vfore, &nv.vaft) == 2) |
138 |
|
change++; |
150 |
– |
else { |
151 |
– |
nv.vfore = ourview.vfore; nv.vaft = ourview.vaft; |
152 |
– |
} |
139 |
|
sprintf(buf, "view shift and lift (%.6g %.6g): ", |
140 |
|
ourview.hoff, ourview.voff); |
141 |
|
(*dev->comout)(buf); |
143 |
|
if (buf[0] == CTRL('C')) return; |
144 |
|
if (sscanf(buf, "%lf %lf", &nv.hoff, &nv.voff) == 2) |
145 |
|
change++; |
160 |
– |
else { |
161 |
– |
nv.hoff = ourview.hoff; nv.voff = ourview.voff; |
162 |
– |
} |
146 |
|
if (change) |
147 |
|
newview(&nv); |
148 |
|
} |
269 |
|
char *s |
270 |
|
) |
271 |
|
{ |
272 |
+ |
VIEW nv = ourview; |
273 |
|
double zfact; |
290 |
– |
VIEW nv; |
274 |
|
|
275 |
|
if (getinterest(s, 1, nv.vdir, &zfact) < 0) |
276 |
|
return; |
294 |
– |
nv.type = ourview.type; |
295 |
– |
VCOPY(nv.vp, ourview.vp); |
296 |
– |
VCOPY(nv.vup, ourview.vup); |
297 |
– |
nv.horiz = ourview.horiz; nv.vert = ourview.vert; |
298 |
– |
nv.vfore = ourview.vfore; nv.vaft = ourview.vaft; |
299 |
– |
nv.hoff = ourview.hoff; nv.voff = ourview.voff; |
277 |
|
zoomview(&nv, zfact); |
278 |
|
newview(&nv); |
279 |
|
} |
298 |
|
char *s |
299 |
|
) |
300 |
|
{ |
301 |
< |
VIEW nv; |
301 |
> |
VIEW nv = ourview; |
302 |
|
FVECT v1; |
303 |
|
double angle, elev, zfact; |
304 |
|
|
307 |
|
error(COMMAND, "missing angle"); |
308 |
|
return; |
309 |
|
} |
333 |
– |
nv.type = ourview.type; |
334 |
– |
VCOPY(nv.vp, ourview.vp); |
335 |
– |
VCOPY(nv.vup, ourview.vup); |
336 |
– |
nv.hoff = ourview.hoff; nv.voff = ourview.voff; |
337 |
– |
nv.vfore = ourview.vfore; nv.vaft = ourview.vaft; |
310 |
|
spinvector(nv.vdir, ourview.vdir, ourview.vup, angle*(PI/180.)); |
311 |
|
if (elev != 0.0) { |
312 |
|
fcross(v1, nv.vdir, ourview.vup); |
313 |
|
normalize(v1); |
314 |
|
spinvector(nv.vdir, nv.vdir, v1, elev*(PI/180.)); |
315 |
|
} |
344 |
– |
nv.horiz = ourview.horiz; nv.vert = ourview.vert; |
316 |
|
zoomview(&nv, zfact); |
317 |
|
newview(&nv); |
318 |
|
} |