--- ray/src/rt/rv2.c 1992/03/04 16:52:10 2.8 +++ ray/src/rt/rv2.c 1993/03/08 12:37:35 2.15 @@ -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; @@ -279,7 +287,7 @@ char *s; for (cp++; isspace(*cp); cp++) ; if (*cp == '\0') { /* interactive */ - sprintf(buf, "exposure (%lf): ", exposure); + sprintf(buf, "exposure (%f): ", exposure); (*dev->comout)(buf); (*dev->comin)(buf, NULL); for (cp = buf; isspace(*cp); cp++) @@ -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; } @@ -390,7 +398,7 @@ register char *s; 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; @@ -427,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); @@ -447,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); @@ -585,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");