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

Comparing ray/src/common/face.c (file contents):
Revision 1.1 by greg, Thu Feb 2 10:34:31 1989 UTC vs.
Revision 1.2 by greg, Tue Feb 21 14:39:54 1989 UTC

# Line 69 | Line 69 | OBJREC  *o;
69          f->area = normalize(f->norm);
70          if (f->area == 0.0) {
71                  objerror(o, WARNING, "zero area");      /* used to be fatal */
72 <                f->const = 0.0;
72 >                f->offset = 0.0;
73                  f->ax = 0;
74                  return(f);
75          }
76          f->area *= 0.5;
77 <                                                /* compute constant */
77 >                                                /* compute offset */
78          badvert = 0;
79 <        f->const = DOT(f->norm, VERTEX(f,0));
79 >        f->offset = DOT(f->norm, VERTEX(f,0));
80          for (i = 1; i < f->nv; i++) {
81                  d1 = DOT(f->norm, VERTEX(f,i));
82 <                badvert += fabs(d1 - f->const/i) > VERTEPS;
83 <                f->const += d1;
82 >                badvert += fabs(d1 - f->offset/i) > VERTEPS;
83 >                f->offset += d1;
84          }
85 <        f->const /= f->nv;
85 >        f->offset /= f->nv;
86          if (badvert)
87                  objerror(o, WARNING, "non-planar vertex");
88                                                  /* find axis */
# Line 90 | Line 90 | OBJREC  *o;
90          if (fabs(f->norm[2]) > fabs(f->norm[f->ax]))
91                  f->ax = 2;
92  
93 <        (FACE *)o->os = f;                      /* save face */
93 >        o->os = (char *)f;                      /* save face */
94          return(f);
95   }
96  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines