ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rv2.c
(Generate patch)

Comparing ray/src/rt/rv2.c (file contents):
Revision 2.21 by greg, Thu Sep 9 14:57:53 1993 UTC vs.
Revision 2.32 by greg, Fri Dec 8 21:27:34 1995 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1993 Regents of the University of California */
1 > /* Copyright (c) 1995 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 140 | Line 140 | char  *s;
140          else {
141                  nv.horiz = ourview.horiz; nv.vert = ourview.vert;
142          }
143 +        sprintf(buf, "fore and aft clipping plane (%.6g %.6g): ",
144 +                        ourview.vfore, ourview.vaft);
145 +        (*dev->comout)(buf);
146 +        (*dev->comin)(buf, NULL);
147 +        if (buf[0] == CTRL('C')) return;
148 +        if (sscanf(buf, "%lf %lf", &nv.vfore, &nv.vaft) == 2)
149 +                change++;
150 +        else {
151 +                nv.vfore = ourview.vfore; nv.vaft = ourview.vaft;
152 +        }
153          sprintf(buf, "view shift and lift (%.6g %.6g): ",
154                          ourview.hoff, ourview.voff);
155          (*dev->comout)(buf);
# Line 276 | Line 286 | char  *s;
286          nv.type = ourview.type;
287          VCOPY(nv.vp, ourview.vp);
288          VCOPY(nv.vup, ourview.vup);
279        nv.hoff = ourview.hoff; nv.voff = ourview.voff;
289          nv.horiz = ourview.horiz; nv.vert = ourview.vert;
290 +        nv.vfore = ourview.vfore; nv.vaft = ourview.vaft;
291 +        nv.hoff = ourview.hoff; nv.voff = ourview.voff;
292          zoomview(&nv, zfact);
293          newview(&nv);
294   }
# Line 311 | Line 322 | char  *s;
322          VCOPY(nv.vp, ourview.vp);
323          VCOPY(nv.vup, ourview.vup);
324          nv.hoff = ourview.hoff; nv.voff = ourview.voff;
325 +        nv.vfore = ourview.vfore; nv.vaft = ourview.vaft;
326          spinvector(nv.vdir, ourview.vdir, ourview.vup, angle*(PI/180.));
327          if (elev != 0.0) {
328                  fcross(v1, nv.vdir, ourview.vup);
# Line 350 | Line 362 | char  *s;
362          register PNODE  *p = &ptrunk;
363          int  adapt = 0;
364          double  e = 1.0;
365 < start:
365 >
366          for (cp = s; isspace(*cp); cp++)
367                  ;
368          if (*cp == '@') {
369                  adapt++;
370 <                goto start;
370 >                while (isspace(*++cp))
371 >                        ;
372          }
373          if (*cp == '\0') {              /* normalize to point */
374                  if (dev->getcur == NULL)
# Line 484 | Line 497 | register char  *s;
497          extern int  ambdiv;
498          extern int  ambssamp;
499          extern int  ambounce;
500 +        extern COLOR  cextinction;
501 +        extern double  salbedo;
502 +        extern double  seccg;
503 +        extern double  ssampdist;
504          extern int  directvis;
505          extern double  srcsizerat;
506          extern int  do_irrad;
507          extern double  specjitter;
508          extern double  specthresh;
509 +        extern int  backvis;
510          char  buf[128];
511          
512          if (s[0] == '\0') {
513                  (*dev->comout)(
514 <                "aa ab ad ar as av b dc di dj ds dt i lr lw ps pt sj st: ");
514 >                "aa ab ad ar as av b dc dv dj ds dt i lr lw me ma mg ms ps pt sj st bv: ");
515                  (*dev->comin)(buf, NULL);
516                  s = buf;
517          }
# Line 532 | Line 550 | register char  *s;
550                          goto badparam;
551                  }
552                  break;
553 <        case 'b':                       /* black and white */
554 <                getparam(s+1, "black and white", 'b', &greyscale);
553 >        case 'b':                       /* back faces or black and white */
554 >                switch (s[1]) {
555 >                case 'v':                       /* back face visibility */
556 >                        getparam(s+2, "back face visibility", 'b', &backvis);
557 >                        break;
558 >                case '\0':                      /* black and white */
559 >                case ' ':
560 >                case 'y': case 'Y': case 't': case 'T': case '1': case '+':
561 >                case 'n': case 'N': case 'f': case 'F': case '0': case '-':
562 >                        getparam(s+1, "black and white", 'b', &greyscale);
563 >                        break;
564 >                default:
565 >                        goto badparam;
566 >                }
567                  break;
568          case 'i':                       /* irradiance */
569                  getparam(s+1, "irradiance", 'b', &do_irrad);
# Line 564 | Line 594 | register char  *s;
594                          goto badparam;
595                  }
596                  break;
597 +        case 'm':                       /* medium */
598 +                switch (s[1]) {
599 +                case 'e':                       /* extinction coefficient */
600 +                        getparam(s+2, "extinction coefficient", 'C',
601 +                                        (COLOR *)cextinction);
602 +                        break;
603 +                case 'a':                       /* scattering albedo */
604 +                        getparam(s+2, "scattering albedo", 'r', &salbedo);
605 +                        break;
606 +                case 'g':                       /* scattering eccentricity */
607 +                        getparam(s+2, "scattering eccentricity", 'r', &seccg);
608 +                        break;
609 +                case 's':                       /* sampling distance */
610 +                        getparam(s+2, "mist sampling distance", 'r',
611 +                                        &ssampdist);
612 +                        break;
613 +                default:
614 +                        goto badparam;
615 +                }
616 +                break;
617          case 'p':                       /* pixel */
618                  switch (s[1]) {
619                  case 's':                       /* sample */
# Line 609 | Line 659 | char  *s;
659          int  x, y;
660          RAY  thisray;
661  
662 +        thisray.rmax = 0.0;
663 +
664          if (!sscanvec(s, thisray.rorg) ||
665                          !sscanvec(sskip(sskip(sskip(s))), thisray.rdir)) {
666  
# Line 618 | Line 670 | char  *s;
670                  if ((*dev->getcur)(&x, &y) == ABORT)
671                          return;
672  
673 <                if (viewray(thisray.rorg, thisray.rdir, &ourview,
674 <                                (x+.5)/hresolu, (y+.5)/vresolu) < 0) {
673 >                if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir,
674 >                        &ourview, (x+.5)/hresolu, (y+.5)/vresolu)) < -FTINY) {
675                          error(COMMAND, "not on image");
676                          return;
677                  }
# Line 636 | Line 688 | char  *s;
688          if (thisray.ro == NULL)
689                  (*dev->comout)("ray hit nothing");
690          else {
691 <                sprintf(buf, "ray hit %s %s \"%s\"",
692 <                                objptr(thisray.ro->omod)->oname,
691 >                sprintf(buf, "ray hit %s%s %s \"%s\"",
692 >                                thisray.rod < 0.0 ? "back of " : "",
693 >                                thisray.ro->omod == OVOID ? VOIDID :
694 >                                        objptr(thisray.ro->omod)->oname,
695                                  ofun[thisray.ro->otype].funame,
696                                  thisray.ro->oname);
697                  (*dev->comout)(buf);
# Line 645 | Line 699 | char  *s;
699                  if (thisray.rot >= FHUGE)
700                          (*dev->comout)("at infinity");
701                  else {
702 <                        sprintf(buf, "at (%.6g %.6g %.6g)", thisray.rop[0],
703 <                                        thisray.rop[1], thisray.rop[2]);
702 >                        sprintf(buf, "at (%.6g %.6g %.6g) (%.6g)",
703 >                                        thisray.rop[0], thisray.rop[1],
704 >                                        thisray.rop[2], thisray.rt);
705                          (*dev->comout)(buf);
706                  }
707                  (*dev->comin)(buf, NULL);
# Line 691 | Line 746 | char  *s;
746          (*dev->comout)(fname);
747          (*dev->comout)("\"...\n");
748                                                  /* write header */
749 +        newheader("RADIANCE", fp);
750          fputs(progname, fp);
751          fprintview(&ourview, fp);
752          if (octname != NULL)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines