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.24 by greg, Mon Feb 28 09:24:43 1994 UTC vs.
Revision 2.28 by greg, Thu Dec 22 11:46:14 1994 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1993 Regents of the University of California */
1 > /* Copyright (c) 1994 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 489 | Line 502 | register char  *s;
502          extern int  do_irrad;
503          extern double  specjitter;
504          extern double  specthresh;
505 +        extern int  backvis;
506          char  buf[128];
507          
508          if (s[0] == '\0') {
509                  (*dev->comout)(
510 <                "aa ab ad ar as av b dc di dj ds dt i lr lw ps pt sj st: ");
510 >                "aa ab ad ar as av b dc di dj ds dt i lr lw ps pt sj st bv: ");
511                  (*dev->comin)(buf, NULL);
512                  s = buf;
513          }
# Line 532 | Line 546 | register char  *s;
546                          goto badparam;
547                  }
548                  break;
549 <        case 'b':                       /* black and white */
550 <                getparam(s+1, "black and white", 'b', &greyscale);
549 >        case 'b':                       /* back faces or black and white */
550 >                switch (s[1]) {
551 >                case 'v':                       /* back face visibility */
552 >                        getparam(s+2, "back face visibility", 'b', &backvis);
553 >                        break;
554 >                case '\0':                      /* black and white */
555 >                case 'y': case 'Y': case 't': case 'T': case '1': case '+':
556 >                case 'n': case 'N': case 'f': case 'F': case '0': case '-':
557 >                        getparam(s+1, "black and white", 'b', &greyscale);
558 >                        break;
559 >                default:
560 >                        goto badparam;
561 >                }
562                  break;
563          case 'i':                       /* irradiance */
564                  getparam(s+1, "irradiance", 'b', &do_irrad);
# Line 609 | Line 634 | char  *s;
634          int  x, y;
635          RAY  thisray;
636  
637 +        thisray.rmax = 0.0;
638 +
639          if (!sscanvec(s, thisray.rorg) ||
640                          !sscanvec(sskip(sskip(sskip(s))), thisray.rdir)) {
641  
# Line 618 | Line 645 | char  *s;
645                  if ((*dev->getcur)(&x, &y) == ABORT)
646                          return;
647  
648 <                if (viewray(thisray.rorg, thisray.rdir, &ourview,
649 <                                (x+.5)/hresolu, (y+.5)/vresolu) < 0) {
648 >                if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir,
649 >                        &ourview, (x+.5)/hresolu, (y+.5)/vresolu)) < -FTINY) {
650                          error(COMMAND, "not on image");
651                          return;
652                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines