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

Comparing ray/src/rt/glass.c (file contents):
Revision 2.2 by greg, Wed May 20 10:24:26 1992 UTC vs.
Revision 2.4 by greg, Wed Oct 14 12:27:47 1992 UTC

# Line 46 | Line 46 | m_glass(m, r)          /* color a ray which hit a thin glass s
46   OBJREC  *m;
47   register RAY  *r;
48   {
49        double  sqrt(), pow();
49          COLOR  mcolor;
50          double  pdot;
51          FVECT  pnorm;
# Line 97 | Line 96 | register RAY  *r;
96                          for (i = 0; i < 3; i++)         /* perturb direction */
97                                  p.rdir[i] = r->rdir[i] +
98                                                  2.*(1.-rindex)*r->pert[i];
99 <                        normalize(p.rdir);
99 >                        if (normalize(p.rdir) == 0.0) {
100 >                                objerror(m, WARNING, "bad perturbation");
101 >                                VCOPY(p.rdir, r->rdir);
102 >                        }
103                  } else {
104                          VCOPY(p.rdir, r->rdir);
105                          transtest = 2;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines