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.6 by greg, Tue Mar 19 11:19:23 1991 UTC vs.
Revision 1.8 by greg, Tue Mar 19 17:21:34 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 + double  threshold = 0.;                 /* glare threshold */
33 +
34   int     sampdens = SAMPDENS;            /* sample density */
35   ANGLE   glarang[180] = {AEND};          /* glare calculation angles */
36   int     nglarangs = 0;
# Line 57 | Line 59 | char   *argv[];
59                          continue;
60                  }
61                  switch (argv[i][1]) {
62 +                case 't':
63 +                        threshold = atof(argv[++i]);
64 +                        break;
65                  case 'r':
66                          sampdens = atoi(argv[++i])/2;
67                          break;
# Line 168 | Line 173 | char   *argv[];
173                  exit(1);
174          }
175          init();                                 /* initialize program */
176 <        comp_thresh();                          /* compute glare threshold */
176 >        if (threshold <= FTINY)
177 >                comp_thresh();                  /* compute glare threshold */
178          analyze();                              /* analyze view */
179          cleanup();                              /* tidy up */
180                                                  /* print header */
# Line 292 | Line 298 | int    x, y;
298                  return(-1);
299          spinvector(vd, vd, ourview.vup, h_theta(x));
300          return(0);
295 }
296
297
298 spinvector(vres, vorig, vnorm, theta)   /* rotate vector around normal */
299 FVECT  vres, vorig, vnorm;
300 double  theta;
301 {
302        extern double  sin(), cos();
303        double  sint, cost, dotp;
304        FVECT  vperp;
305        register int  i;
306        
307        sint = sin(theta);
308        cost = cos(theta);
309        dotp = DOT(vorig, vnorm);
310        fcross(vperp, vnorm, vorig);
311        for (i = 0; i < 3; i++)
312                vres[i] = vnorm[i]*dotp*(1.-cost) +
313                                vorig[i]*cost + vperp[i]*sint;
301   }
302  
303  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines