--- ray/src/rt/rv2.c 1992/02/18 16:38:51 2.7 +++ ray/src/rt/rv2.c 1992/12/11 17:56:22 2.14 @@ -1,4 +1,4 @@ -/* Copyright (c) 1991 Regents of the University of California */ +/* Copyright (c) 1992 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; @@ -65,6 +65,16 @@ char *s; int change = 0; VIEW nv; + while (isspace(*s)) + s++; + if (*s == '-') { /* command line parameters */ + copystruct(&nv, &ourview); + if (sscanview(&nv, s)) + newview(&nv); + else + error(COMMAND, "bad view option(s)"); + return; + } if (sscanf(s, "%s", buf) == 1) { /* write parameters to a file */ if ((fname = getpath(buf, NULL, 0)) == NULL || (fp = fopen(fname, "a")) == NULL) { @@ -176,7 +186,6 @@ char *s; getaim(s) /* aim camera */ char *s; { - extern double tan(), atan(); double zfact; VIEW nv; @@ -207,7 +216,6 @@ char *s; getrotate(s) /* rotate camera */ char *s; { - extern double normalize(), tan(), atan(); VIEW nv; FVECT v1; double angle, elev, zfact; @@ -297,7 +305,7 @@ char *s; e *= atof(cp); } if (p != NULL) { /* relative setting */ - if (bright(p->v) < 1e-25) { + if (bright(p->v) < 1e-15) { error(COMMAND, "cannot normalize to zero"); return; } @@ -386,12 +394,11 @@ register char *s; extern double shadcert; extern COLOR ambval; extern double ambacc; - extern double minarad; extern int ambres; extern int ambdiv; extern int ambssamp; extern int ambounce; - extern int directinvis; + extern int directvis; extern double srcsizerat; extern int do_irrad; extern double specjitter; @@ -428,9 +435,9 @@ register char *s; case 't': /* threshold */ getparam(s+2, "direct threshold", 'r', &shadthresh); break; - case 'i': /* invisibility */ - getparam(s+2, "direct invisibility", - 'b', &directinvis); + case 'v': /* visibility */ + getparam(s+2, "direct visibility", + 'b', &directvis); break; case 's': /* sampling */ getparam(s+2, "direct sampling", 'r', &srcsizerat); @@ -448,7 +455,7 @@ register char *s; case 'a': /* ambient */ switch (s[1]) { case 'v': /* value */ - getparam(s+2, "ambient value", 'C', ambval); + getparam(s+2, "ambient value", 'C', (COLOR *)ambval); break; case 'a': /* accuracy */ getparam(s+2, "ambient accuracy", 'r', &ambacc); @@ -464,8 +471,7 @@ register char *s; break; case 'r': if (getparam(s+2, "ambient resolution", 'i', &ambres)) - minarad = ambres > 0 ? - thescene.cusize/ambres : 0.0; + setambres(ambres); break; default: goto badparam; @@ -587,6 +593,9 @@ char *s; error(COMMAND, errmsg); return; } +#ifdef MSDOS + setmode(fileno(fp), O_BINARY); +#endif (*dev->comout)("writing \""); (*dev->comout)(fname); (*dev->comout)("\"...\n");