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.14 by greg, Tue Apr 2 16:47:03 1991 UTC

# Line 12 | Line 12 | static char SCCSid[] = "$SunId$ LBL";
12  
13   #include "glare.h"
14  
15 + #include "random.h"
16 +
17   #define FEQ(a,b)        ((a)-(b)<=FTINY&&(a)-(b)<=FTINY)
18   #define VEQ(v1,v2)      (FEQ((v1)[0],(v2)[0])&&FEQ((v1)[1],(v2)[1]) \
19                                  &&FEQ((v1)[2],(v2)[2]))
# Line 290 | Line 292 | compdir(vd, x, y)                      /* compute direction for x,y */
292   FVECT   vd;
293   int     x, y;
294   {
295 +        long    t;
296          FVECT   org;                    /* dummy variable */
297  
298          if (x <= -hlim)                 /* left region */
# Line 300 | Line 303 | int    x, y;
303                  return(viewray(org, vd, &rightview,
304                                  (double)(x-hlim)/(2*sampdens)+.5,
305                                  (double)y/(2*sampdens)+.5));
306 <                                                /* central region */
306 >                                        /* central region */
307 >                                /* avoid over-counting of poles */
308 >        t = random() % vsize;
309 >        if (t*t >= (long)vsize*vsize - (long)y*y)
310 >                return(-1);
311          if (viewray(org, vd, &ourview, .5, (double)y/(2*sampdens)+.5) < 0)
312                  return(-1);
313          spinvector(vd, vd, ourview.vup, h_theta(x));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines