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 |
|
|
318 |
|
extern int ambdiv; |
319 |
|
extern int ambssamp; |
320 |
|
extern int ambounce; |
321 |
+ |
extern int directinvis; |
322 |
+ |
extern int do_irrad; |
323 |
|
int i0; |
324 |
|
double d0, d1, d2; |
325 |
< |
char buf[128]; |
325 |
> |
char buf[128], ans[4]; |
326 |
|
|
327 |
|
if (s[0] == '\0') { |
328 |
< |
(*dev->comout)("aa ab ad ar as av dc dj dt lr lw sp st: "); |
328 |
> |
(*dev->comout)( |
329 |
> |
"aa ab ad ar as av b dc dj di dt i lr lw sp st: "); |
330 |
|
(*dev->comin)(buf, NULL); |
331 |
|
s = buf; |
332 |
|
} |
394 |
|
} |
395 |
|
shadthresh = d0; |
396 |
|
break; |
397 |
+ |
case 'i': /* invisibility */ |
398 |
+ |
if (sscanf(s+2, "%1s", ans) != 1) { |
399 |
+ |
sprintf(buf, "direct invisibility (%c): ", |
400 |
+ |
directinvis ? 'y' : 'n'); |
401 |
+ |
(*dev->comout)(buf); |
402 |
+ |
(*dev->comin)(buf, NULL); |
403 |
+ |
if (sscanf(buf, "%1s", ans) != 1) |
404 |
+ |
break; |
405 |
+ |
} |
406 |
+ |
directinvis = tolower(ans[0]) == 'y'; |
407 |
+ |
break; |
408 |
|
default: |
409 |
|
goto badparam; |
410 |
|
} |
411 |
|
break; |
412 |
+ |
case 'b': /* black and white */ |
413 |
+ |
if (sscanf(s+1, "%1s", ans) != 1) { |
414 |
+ |
sprintf(buf, "black and white (%c): ", |
415 |
+ |
greyscale ? 'y' : 'n'); |
416 |
+ |
(*dev->comout)(buf); |
417 |
+ |
(*dev->comin)(buf, NULL); |
418 |
+ |
if (sscanf(buf, "%1s", ans) != 1) |
419 |
+ |
break; |
420 |
+ |
} |
421 |
+ |
greyscale = tolower(ans[0]) == 'y'; |
422 |
+ |
break; |
423 |
+ |
case 'i': /* irradiance */ |
424 |
+ |
if (sscanf(s+1, "%1s", ans) != 1) { |
425 |
+ |
sprintf(buf, "irradiance (%c): ", |
426 |
+ |
do_irrad ? 'y' : 'n'); |
427 |
+ |
(*dev->comout)(buf); |
428 |
+ |
(*dev->comin)(buf, NULL); |
429 |
+ |
if (sscanf(buf, "%1s", ans) != 1) |
430 |
+ |
break; |
431 |
+ |
} |
432 |
+ |
do_irrad = tolower(ans[0]) == 'y'; |
433 |
+ |
break; |
434 |
|
case 'a': /* ambient */ |
435 |
|
switch (s[1]) { |
436 |
|
case 'v': /* value */ |
565 |
|
if ((*dev->getcur)(&x, &y) == ABORT) |
566 |
|
return; |
567 |
|
|
568 |
< |
viewray(thisray.rorg, thisray.rdir, &ourview, |
569 |
< |
(x+.5)/hresolu, (y+.5)/vresolu); |
570 |
< |
|
568 |
> |
if (viewray(thisray.rorg, thisray.rdir, &ourview, |
569 |
> |
(x+.5)/hresolu, (y+.5)/vresolu) < 0) { |
570 |
> |
error(COMMAND, "not on image"); |
571 |
> |
return; |
572 |
> |
} |
573 |
> |
|
574 |
|
} else if (normalize(thisray.rdir) == 0.0) { |
575 |
|
error(COMMAND, "zero ray direction"); |
576 |
|
return; |
637 |
|
fputexpos(exposure, fp); |
638 |
|
if (dev->pixaspect != 1.0) |
639 |
|
fputaspect(dev->pixaspect, fp); |
640 |
+ |
fputformat(COLRFMT, fp); |
641 |
|
putc('\n', fp); |
642 |
|
fputresolu(YMAJOR|YDECR, hresolu, vresolu, fp); |
643 |
|
|