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

Comparing ray/src/rt/ambcomp.c (file contents):
Revision 2.36 by greg, Sat Apr 26 04:37:48 2014 UTC vs.
Revision 2.37 by greg, Sat Apr 26 05:09:54 2014 UTC

# Line 70 | Line 70 | inithemi(                      /* initialize sampling hemisphere */
70          d = 1.0/(n*n);
71          scalecolor(hp->acoef, d);
72                                          /* make tangent plane axes */
73 <        hp->uy[0] = hp->uy[1] = hp->uy[2] = 0;
73 >        hp->uy[0] = hp->uy[1] = hp->uy[2] = 0.0;
74          for (i = 3; i--; )
75 <                if ((0.6 < r->ron[i]) & (r->ron[i] < 0.6))
76 <                        hp->uy[i] = 0.1+frandom();
77 <        if (DOT(hp->uy,hp->uy) <= FTINY)
78 <                error(CONSISTENCY, "bad ray direction in inithemi()");
75 >                if ((-0.6 < r->ron[i]) & (r->ron[i] < 0.6))
76 >                        break;
77 >        if (i < 0)
78 >                error(CONSISTENCY, "bad ray direction in inithemi");
79 >        hp->uy[i] = 1.0;
80          VCROSS(hp->ux, hp->uy, r->ron);
81          normalize(hp->ux);
82          VCROSS(hp->uy, r->ron, hp->ux);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines