--- ray/src/rt/rv2.c 1994/02/28 09:24:43 2.24 +++ ray/src/rt/rv2.c 1994/12/21 09:52:03 2.27 @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 Regents of the University of California */ +/* Copyright (c) 1994 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; @@ -140,6 +140,16 @@ char *s; else { nv.horiz = ourview.horiz; nv.vert = ourview.vert; } + sprintf(buf, "fore and aft clipping plane (%.6g %.6g): ", + ourview.vfore, ourview.vaft); + (*dev->comout)(buf); + (*dev->comin)(buf, NULL); + if (buf[0] == CTRL('C')) return; + if (sscanf(buf, "%lf %lf", &nv.vfore, &nv.vaft) == 2) + change++; + else { + nv.vfore = ourview.vfore; nv.vaft = ourview.vaft; + } sprintf(buf, "view shift and lift (%.6g %.6g): ", ourview.hoff, ourview.voff); (*dev->comout)(buf); @@ -350,12 +360,13 @@ char *s; register PNODE *p = &ptrunk; int adapt = 0; double e = 1.0; -start: + for (cp = s; isspace(*cp); cp++) ; if (*cp == '@') { adapt++; - goto start; + while (isspace(*++cp)) + ; } if (*cp == '\0') { /* normalize to point */ if (dev->getcur == NULL) @@ -489,11 +500,12 @@ register char *s; extern int do_irrad; extern double specjitter; extern double specthresh; + extern int backvis; char buf[128]; if (s[0] == '\0') { (*dev->comout)( - "aa ab ad ar as av b dc di dj ds dt i lr lw ps pt sj st: "); + "aa ab ad ar as av b dc di dj ds dt i lr lw ps pt sj st bv: "); (*dev->comin)(buf, NULL); s = buf; } @@ -532,8 +544,19 @@ register char *s; goto badparam; } break; - case 'b': /* black and white */ - getparam(s+1, "black and white", 'b', &greyscale); + case 'b': /* back faces or black and white */ + switch (s[1]) { + case 'v': /* back face visibility */ + getparam(s+2, "back face visibility", 'b', &backvis); + break; + case '\0': /* black and white */ + case 'y': case 'Y': case 't': case 'T': case '1': case '+': + case 'n': case 'N': case 'f': case 'F': case '0': case '-': + getparam(s+1, "black and white", 'b', &greyscale); + break; + default: + goto badparam; + } break; case 'i': /* irradiance */ getparam(s+1, "irradiance", 'b', &do_irrad); @@ -609,6 +632,8 @@ char *s; int x, y; RAY thisray; + thisray.rmax = 0.0; + if (!sscanvec(s, thisray.rorg) || !sscanvec(sskip(sskip(sskip(s))), thisray.rdir)) { @@ -618,8 +643,8 @@ char *s; if ((*dev->getcur)(&x, &y) == ABORT) return; - if (viewray(thisray.rorg, thisray.rdir, &ourview, - (x+.5)/hresolu, (y+.5)/vresolu) < 0) { + if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir, + &ourview, (x+.5)/hresolu, (y+.5)/vresolu)) < -FTINY) { error(COMMAND, "not on image"); return; }