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

Comparing ray/src/gen/mkillum2.c (file contents):
Revision 2.4 by greg, Thu Aug 13 10:03:19 1992 UTC vs.
Revision 2.5 by greg, Thu Aug 13 11:23:46 1992 UTC

# Line 71 | Line 71 | char  *nm;
71                  u[0] = VERTEX(fa,i)[0] - VERTEX(fa,j)[0];
72                  u[1] = VERTEX(fa,i)[1] - VERTEX(fa,j)[1];
73                  u[2] = VERTEX(fa,i)[2] - VERTEX(fa,j)[2];
74 <                if (DOT(u,u) >= fa->area-FTINY)
74 >                if ((r1 = DOT(u,u)) >= fa->area-FTINY)
75                          break;
76          }
77          if (i < fa->nv) {       /* got one! -- let's align our axes */
78 <                normalize(u);
78 >                r2 = 1.0/sqrt(r1);
79 >                u[0] *= r2; u[1] *= r2; u[2] *= r2;
80                  fcross(v, fa->norm, u);
81          } else                  /* oh well, we'll just have to wing it */
82                  mkaxes(u, v, fa->norm);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines