--- ray/src/rt/rview.c 1993/02/10 14:03:01 2.10 +++ ray/src/rt/rview.c 1996/02/14 15:18:09 2.16 @@ -1,4 +1,4 @@ -/* Copyright (c) 1992 Regents of the University of California */ +/* Copyright (c) 1995 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; @@ -38,13 +38,21 @@ int vspretest = 128; /* virtual source pretest dens int directvis = 1; /* sources visible? */ double srcsizerat = 0.; /* maximum ratio source size/dist. */ +COLOR cextinction = BLKCOLOR; /* global extinction coefficient */ +double salbedo = 0.; /* global scattering albedo */ +double seccg = 0.; /* global scattering eccentricity */ +double ssampdist = 0.; /* scatter sampling distance */ + double specthresh = .3; /* specular sampling threshold */ double specjitter = 1.; /* specular sampling jitter */ +int backvis = 1; /* back face visibility */ + int maxdepth = 4; /* maximum recursion depth */ double minweight = 1e-2; /* minimum ray weight */ COLOR ambval = BLKCOLOR; /* ambient value */ +int ambvwt = 0; /* initial weight for ambient value */ double ambacc = 0.2; /* ambient accuracy */ int ambres = 8; /* ambient resolution */ int ambdiv = 32; /* ambient divisions */ @@ -58,6 +66,8 @@ char *devname = dev_default; /* output device name * struct driver *dev = NULL; /* driver functions */ +char rifname[128]; /* rad input file name */ + VIEW oldview; /* previous view parameters */ PNODE ptrunk; /* the base of our image */ @@ -208,14 +218,29 @@ again: goto commerr; lastview(args); break; + case 'V': /* save view */ + if (badcom("V")) + goto commerr; + saveview(args); + break; + case 'L': /* load view */ + if (badcom("L")) + goto commerr; + loadview(args); + break; case 'e': /* exposure */ if (badcom("exposure")) goto commerr; getexposure(args); break; case 's': /* set a parameter */ - if (badcom("set")) + if (badcom("set")) { +#ifdef SIGTSTP + if (!badcom("stop")) + goto dostop; +#endif goto commerr; + } setparam(args); break; case 'n': /* new picture */ @@ -249,16 +274,23 @@ again: break; case 'r': /* rotate/repaint */ if (badcom("rotate")) { - if (badcom("repaint")) - goto commerr; + if (badcom("repaint")) { + if (badcom("redraw")) + goto commerr; + redraw(); + break; + } getrepaint(args); break; } getrotate(args); break; case 'p': /* pivot view */ - if (badcom("pivot")) - goto commerr; + if (badcom("pivot")) { + if (badcom("pause")) + goto commerr; + goto again; + } getpivot(args); break; case CTRL('R'): /* redraw */ @@ -276,7 +308,8 @@ again: case CTRL('C'): /* interrupt */ goto again; #ifdef SIGTSTP - case CTRL('Z'): /* stop */ + case CTRL('Z'):; /* stop */ +dostop: devclose(); kill(0, SIGTSTP); /* pc stops here */ @@ -315,8 +348,8 @@ rsample() /* sample the image */ * difference, we subsample the super-pixels. The testing process * includes initialization of the next row. */ - xsiz = (((pframe.r-pframe.l)<