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.16 by greg, Wed Apr 10 15:59:07 1991 UTC vs.
Revision 1.17 by greg, Fri Apr 12 10:28:40 1991 UTC

# Line 281 | Line 281 | init()                         /* initialize global variables */
281   cleanup()                               /* close files, wait for children */
282   {
283          if (verbose)
284 <                fprintf(stderr, "%s: cleaning up...\n", progname);
284 >                fprintf(stderr, "%s: cleaning up...        \n", progname);
285          if (picture != NULL)
286                  close_pict();
287          if (octree != NULL)
# Line 292 | Line 292 | cleanup()                              /* close files, wait for children */
292   }
293  
294  
295 < compdir(vd, x, y)                       /* compute direction for x,y */
295 > compdir(vd, x, y, se)                   /* compute direction for x,y */
296   FVECT   vd;
297   int     x, y;
298 + SPANERR *se;
299   {
299        static int      cury = 10000;
300        static double   err, cmpval;
301        long    t;
300          FVECT   org;                    /* dummy variable */
301  
302          if (x <= -hlim)                 /* left region */
# Line 310 | Line 308 | int    x, y;
308                                  (double)(x-hlim)/(2*sampdens)+.5,
309                                  (double)y/(2*sampdens)+.5));
310                                          /* central region */
311 <                                /* avoid over-counting of poles */
312 <        if (cury != y) {
313 <                err = 0.0;
314 <                cmpval = sqrt(1.0 - (double)((long)y*y)/((long)vsize*vsize));
315 <                cury = y;
311 >        if (se != NULL) {       /* avoid over-counting of poles */
312 >                se->err += se->prob;
313 >                if (se->err <= 0.5)
314 >                        return(-1);
315 >                se->err -= 1.0;
316          }
319        err += cmpval;
320        if (err <= 0.5)
321                return(-1);
322        err -= 1.0;
317          if (viewray(org, vd, &ourview, .5, (double)y/(2*sampdens)+.5) < 0)
318                  return(-1);
319          spinvector(vd, vd, ourview.vup, h_theta(x));
320          return(0);
321 + }
322 +
323 +
324 + setspanerr(se, y)               /* initialize span error at y */
325 + register SPANERR        *se;
326 + int     y;
327 + {
328 +        se->err = 0.0;
329 +        se->prob = sqrt(1.0 - (double)((long)y*y)/((long)vsize*vsize));
330   }
331  
332  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines