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.4 by greg, Mon Mar 18 16:21:09 1991 UTC vs.
Revision 1.7 by greg, Tue Mar 19 17:06:21 1991 UTC

# Line 19 | Line 19 | static char SCCSid[] = "$SunId$ LBL";
19   char    *rtargv[32] = {"rtrace", "-h", "-ov", "-fff"};
20   int     rtargc = 4;
21  
22 < VIEW    ourview;                        /* our view */
22 > VIEW    ourview = STDVIEW;              /* our view */
23   VIEW    pictview = STDVIEW;             /* picture view */
24   VIEW    leftview, rightview;            /* leftmost and rightmost views */
25  
# Line 205 | Line 205 | init()                         /* initialize global variables */
205          }
206          nglarangs = i;
207          /* nglardirs = 2*nglarangs + 1; */
208 <        /* vsize = sampdens; */
208 >        /* vsize = sampdens - 1; */
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;
214 >        hsize = hlim + sampdens - 1;
215          if (hsize > (int)(PI*sampdens))
216                  hsize = PI*sampdens;
217          indirect = (struct illum *)calloc(nglardirs, sizeof(struct illum));
# Line 295 | Line 295 | int    x, y;
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;
314 }
315
316
298   memerr(s)                       /* malloc failure */
299   char    *s;
300   {
301 <        fprintf(stderr, "%s: out of memory for %s\n", s);
301 >        fprintf(stderr, "%s: out of memory for %s\n", progname, s);
302          exit(1);
303   }
304  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines