--- ray/src/ot/oconv.c 1989/04/10 17:00:27 1.3 +++ ray/src/ot/oconv.c 1989/06/21 08:56:35 1.5 @@ -59,6 +59,8 @@ char **argv; for (i = 1; i < argc && argv[i][0] == '-'; i++) switch (argv[i][1]) { + case '\0': /* scene from stdin */ + goto breakopt; case 'i': /* input octree */ infile = argv[++i]; break; @@ -85,7 +87,7 @@ char **argv; error(USER, errmsg); break; } - +breakopt: if (infile != NULL) { /* get old octree & objects */ if (thescene.cusize > FTINY) error(USER, "only one of '-b' or '-i'"); @@ -101,11 +103,16 @@ char **argv; startobj = nobjects; /* previous objects already converted */ - for ( ; i < argc; i++) { /* read new files */ - if (nfiles >= MAXOBJFIL) - error(INTERNAL, "too many scene files"); - readobj(ofname[nfiles++] = argv[i]); - } + for ( ; i < argc; i++) /* read new scene descriptions */ + if (!strcmp(argv[i], "-")) { /* from stdin */ + readobj(NULL); + outflags &= ~IO_FILES; + } else { /* from file */ + if (nfiles >= MAXOBJFIL) + error(INTERNAL, "too many scene files"); + readobj(ofname[nfiles++] = argv[i]); + } + ofname[nfiles] = NULL; /* find bounding box */ bbmin[0] = bbmin[1] = bbmin[2] = FHUGE;