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

Comparing ray/src/util/findglare.c (file contents):
Revision 1.13 by greg, Tue Apr 2 14:29:15 1991 UTC vs.
Revision 1.16 by greg, Wed Apr 10 15:59:07 1991 UTC

# Line 48 | Line 48 | main(argc, argv)
48   int     argc;
49   char    *argv[];
50   {
51 +        int     combine = 1;
52          int     gotview = 0;
53          int     rval, i;
54          char    *err;
# Line 101 | Line 102 | char   *argv[];
102                  case 'p':
103                          picture = argv[++i];
104                          break;
105 +                case 'c':
106 +                        combine = !combine;
107 +                        break;
108                  case 'd':
109                  case 'l':
110                          rtargv[rtargc++] = argv[i];
# Line 179 | Line 183 | char   *argv[];
183          if (threshold <= FTINY)
184                  comp_thresh();                  /* compute glare threshold */
185          analyze();                              /* analyze view */
186 +        if (combine)
187 +                absorb_specks();                /* eliminate tiny sources */
188          cleanup();                              /* tidy up */
189                                                  /* print header */
190          printargs(argc, argv, stdout);
# Line 290 | Line 296 | compdir(vd, x, y)                      /* compute direction for x,y */
296   FVECT   vd;
297   int     x, y;
298   {
299 +        static int      cury = 10000;
300 +        static double   err, cmpval;
301 +        long    t;
302          FVECT   org;                    /* dummy variable */
303  
304          if (x <= -hlim)                 /* left region */
# Line 300 | Line 309 | int    x, y;
309                  return(viewray(org, vd, &rightview,
310                                  (double)(x-hlim)/(2*sampdens)+.5,
311                                  (double)y/(2*sampdens)+.5));
312 <                                                /* central region */
312 >                                        /* central region */
313 >                                /* avoid over-counting of poles */
314 >        if (cury != y) {
315 >                err = 0.0;
316 >                cmpval = sqrt(1.0 - (double)((long)y*y)/((long)vsize*vsize));
317 >                cury = y;
318 >        }
319 >        err += cmpval;
320 >        if (err <= 0.5)
321 >                return(-1);
322 >        err -= 1.0;
323          if (viewray(org, vd, &ourview, .5, (double)y/(2*sampdens)+.5) < 0)
324                  return(-1);
325          spinvector(vd, vd, ourview.vup, h_theta(x));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines