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

Comparing ray/src/rt/rv3.c (file contents):
Revision 2.37 by greg, Tue Mar 20 03:37:08 2012 UTC vs.
Revision 2.42 by greg, Thu Nov 8 00:54:07 2018 UTC

# Line 13 | Line 13 | static const char      RCSid[] = "$Id$";
13  
14   #include  "ray.h"
15   #include  "rpaint.h"
16 + #include  "otypes.h"
17 + #include  "otspecial.h"
18   #include  "random.h"
19  
20   #ifndef WFLUSH
# Line 114 | Line 116 | getinterest(           /* get area of interest */
116                  }
117                  if (!direc || ourview.type == VT_PAR) {
118                          rayorigin(&thisray, PRIMARY, NULL, NULL);
119 <                        if (!localhit(&thisray, &thescene)) {
119 >                        while (localhit(&thisray, &thescene)) {
120 >                                OBJREC  *m = findmaterial(thisray.ro);
121 >                                if (m != NULL && !istransp(m->otype) &&
122 >                                                !isBSDFproxy(m) &&
123 >                                                (thisray.clipset == NULL ||
124 >                                                        !inset(thisray.clipset,
125 >                                                            thisray.ro->omod)))
126 >                                        break;          /* found something */
127 >                                VCOPY(thisray.rorg, thisray.rop);
128 >                                rayclear(&thisray);     /* skip invisible */
129 >                        }
130 >                        if ((thisray.ro == NULL) | (thisray.ro == &Aftplane)) {
131                                  error(COMMAND, "not a local object");
132                                  return(-1);
133                          }
# Line 139 | Line 152 | getinterest(           /* get area of interest */
152   }
153  
154  
155 < float *         /* keep consistent with COLOR typedef */
155 > COLORV *
156   greyof(                         /* convert color to greyscale */
157          COLOR  col
158   )
# Line 224 | Line 237 | paint(                 /* compute and paint a rectangle */
237                  } else if (ambounce == 0)
238                          flushintvl = ray_pnprocs*WFLUSH;
239                  else if (niflush < WFLUSH)
240 <                        flushintvl = ray_pnprocs*niflush/(ambounce+1);
240 >                        flushintvl = ray_pnprocs*niflush/(ambounce*(ambounce>0)+1);
241                  else
242 <                        flushintvl = ray_pnprocs*WFLUSH/(ambounce+1);
242 >                        flushintvl = ray_pnprocs*WFLUSH/(ambounce*(ambounce>0)+1);
243                  if (lastflush > counter)
244                          lastflush = 0;          /* counter wrapped */
245  
# Line 517 | Line 530 | moveview(                                      /* move viewpoint */
530   )
531   {
532          double  d;
520        FVECT  v1;
533          VIEW  nv = ourview;
534          int  i;
535  
536          spinvector(nv.vdir, ourview.vdir, ourview.vup, angle*(PI/180.));
537 <        if (elev != 0.0) {
538 <                fcross(v1, ourview.vup, nv.vdir);
539 <                normalize(v1);
528 <                spinvector(nv.vdir, nv.vdir, v1, elev*(PI/180.));
529 <        }
537 >        if (elev != 0.0)
538 >                geodesic(nv.vdir, nv.vdir, nv.vup, elev*(-PI/180.), GEOD_RAD);
539 >
540          if (nv.type == VT_PAR) {
541                  nv.horiz /= mag;
542                  nv.vert /= mag;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines