ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rholo.c
(Generate patch)

Comparing ray/src/hd/rholo.c (file contents):
Revision 3.33 by gregl, Wed Dec 31 20:45:31 1997 UTC vs.
Revision 3.37 by gregl, Fri Jan 16 11:45:43 1998 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1997 Silicon Graphics, Inc. */
1 > /* Copyright (c) 1998 Silicon Graphics, Inc. */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ SGI";
# Line 109 | Line 109 | char   *argv[];
109                  }
110                                                  /* check settings */
111          checkvalues();
112 <                                                /* load RIF if any */
112 >                                                /* load rad input file */
113          getradfile();
114  
115          if (hdlist[0] == NULL) {                /* create new holodeck */
# Line 175 | Line 175 | int    fd, mod;
175          if (fstat(fd, &stbuf) < 0)
176                  error(SYSTEM, "cannot stat open holodeck file");
177          mod &= stbuf.st_mode;           /* always more restrictive */
178 <        if (mod == stbuf.st_mode)
178 >        if (mod == (stbuf.st_mode & 0777))
179                  return(-1);             /* already set */
180                                          /* else change it */
181          if (fchmod(fd, mod) < 0) {
# Line 332 | Line 332 | register HDGRID        *gp;
332          extern char     *atos();
333          register int    i;
334          int     n;
335 <        double  len[3], maxlen, d;
335 >        double  len[3], d;
336          char    buf[64];
337  
338          if (!vdef(SECTION)) {
# Line 366 | Line 366 | register HDGRID        *gp;
366                                  &gp->xv[2][0], &gp->xv[2][1], &gp->xv[2][2],
367                                  &gp->grid[0], &gp->grid[1], &gp->grid[2]) < 12)
368                          badvalue(SECTION);
369                maxlen = 0.;
369                  for (i = 0; i < 3; i++)
370 <                        if ((len[i] = VLEN(gp->xv[i])) > maxlen)
371 <                                maxlen = len[i];
372 <                if (!vdef(GRID))
373 <                        d = 0.125*maxlen;
374 <                else if ((d = vflt(GRID)) <= FTINY)
370 >                        len[i] = VLEN(gp->xv[i]);
371 >                if (!vdef(GRID)) {
372 >                        d = 2/5e5*( len[0]*len[0]*(len[1]*len[1] +
373 >                                        len[2]*len[2] + 4*len[1]*len[2])
374 >                                + len[1]*len[1]*len[2]*(len[2] + 4*len[0])
375 >                                + 4*len[0]*len[1]*len[2]*len[2] );
376 >                        d = sqrt(sqrt(d));
377 >                } else if ((d = vflt(GRID)) <= FTINY)
378                          badvalue(GRID);
379                  for (i = 0; i < 3; i++)
380                          if (gp->grid[i] <= 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines