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

Comparing ray/src/rt/sphere.c (file contents):
Revision 1.1 by greg, Thu Feb 2 10:41:42 1989 UTC vs.
Revision 1.2 by greg, Wed Apr 19 22:24:30 1989 UTC

# Line 57 | Line 57 | register RAY  *r;
57          if (i >= nroots)
58                  return(0);                      /* no positive root */
59  
60 <        if (t < r->rot) {                       /* found closer intersection */
61 <                r->ro = so;
62 <                r->rot = t;
63 <                                                /* compute normal */
64 <                a = ap[3];
65 <                if (so->otype == OBJ_BUBBLE)
66 <                        a = -a;                 /* reverse */
67 <                for (i = 0; i < 3; i++) {
68 <                        r->rop[i] = r->rorg[i] + r->rdir[i]*t;
69 <                        r->ron[i] = (r->rop[i] - ap[i]) / a;
70 <                }
71 <                r->rod = -DOT(r->rdir, r->ron);
60 >        if (t >= r->rot)
61 >                return(0);                      /* other is closer */
62 >
63 >        r->ro = so;
64 >        r->rot = t;
65 >                                        /* compute normal */
66 >        a = ap[3];
67 >        if (so->otype == OBJ_BUBBLE)
68 >                a = -a;                 /* reverse */
69 >        for (i = 0; i < 3; i++) {
70 >                r->rop[i] = r->rorg[i] + r->rdir[i]*t;
71 >                r->ron[i] = (r->rop[i] - ap[i]) / a;
72          }
73 <        return(1);
73 >        r->rod = -DOT(r->rdir, r->ron);
74 >        r->rofs = 1.0; setident4(r->rofx);
75 >        r->robs = 1.0; setident4(r->robx);
76 >
77 >        return(1);                      /* hit */
78   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines