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.3 by greg, Mon Mar 18 15:06:49 1991 UTC vs.
Revision 1.4 by greg, Mon Mar 18 16:21:09 1991 UTC

# Line 29 | Line 29 | char   *octree = NULL;                 /* octree file name */
29   int     verbose = 0;                    /* verbose reporting */
30   char    *progname;                      /* global argv[0] */
31  
32 + int     sampdens = SAMPDENS;            /* sample density */
33   ANGLE   glarang[180] = {AEND};          /* glare calculation angles */
34   int     nglarangs = 0;
35   double  maxtheta;                       /* maximum angle (in radians) */
# Line 56 | Line 57 | char   *argv[];
57                          continue;
58                  }
59                  switch (argv[i][1]) {
60 +                case 'r':
61 +                        sampdens = atoi(argv[++i])/2;
62 +                        break;
63                  case 'v':
64                          if (argv[i][2] == '\0') {
65                                  verbose++;
# Line 201 | Line 205 | init()                         /* initialize global variables */
205          }
206          nglarangs = i;
207          /* nglardirs = 2*nglarangs + 1; */
208 <        /* vsize = SAMPDENS; */
208 >        /* vsize = sampdens; */
209          if (nglarangs > 0)
210                  maxtheta = (PI/180.)*glarang[nglarangs-1];
211          else
212                  maxtheta = 0.0;
213 <        hlim = SAMPDENS*maxtheta;
214 <        hsize = SAMPDENS + hlim;
215 <        if (hsize > (int)(PI*SAMPDENS))
216 <                hsize = PI*SAMPDENS;
213 >        hlim = sampdens*maxtheta;
214 >        hsize = sampdens + hlim;
215 >        if (hsize > (int)(PI*sampdens))
216 >                hsize = PI*sampdens;
217          indirect = (struct illum *)calloc(nglardirs, sizeof(struct illum));
218          if (indirect == NULL)
219                  memerr("indirect illuminances");
# Line 277 | Line 281 | int    x, y;
281  
282          if (x <= -hlim)                 /* left region */
283                  return(viewray(org, vd, &leftview,
284 <                                (x+hlim)/(2.*SAMPDENS)+.5,
285 <                                y/(2.*SAMPDENS)+.5));
284 >                                (x+hlim)/(2.*sampdens)+.5,
285 >                                y/(2.*sampdens)+.5));
286          if (x >= hlim)                  /* right region */
287                  return(viewray(org, vd, &rightview,
288 <                                (x-hlim)/(2.*SAMPDENS)+.5,
289 <                                y/(2.*SAMPDENS)+.5));
288 >                                (x-hlim)/(2.*sampdens)+.5,
289 >                                y/(2.*sampdens)+.5));
290                                                  /* central region */
291 <        if (viewray(org, vd, &ourview, .5, y/(2.*SAMPDENS)+.5) < 0)
291 >        if (viewray(org, vd, &ourview, .5, y/(2.*sampdens)+.5) < 0)
292                  return(-1);
293          spinvector(vd, vd, ourview.vup, h_theta(x));
294          return(0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines