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

Comparing ray/src/cv/bsdfinterp.c (file contents):
Revision 2.4 by greg, Tue Oct 23 21:09:29 2012 UTC vs.
Revision 2.5 by greg, Thu Nov 8 00:31:17 2012 UTC

# Line 202 | Line 202 | get_interp(MIGRATION *miga[3], FVECT invec)
202                                                          input_orient*invec[2]) {
203                                  for (miga[0] = rbf->ejl; miga[0] != NULL;
204                                                  miga[0] = nextedge(rbf,miga[0]))
205 <                                        if (opp_rbf(rbf,miga[0]) == rbf->next)
205 >                                        if (opp_rbf(rbf,miga[0]) == rbf->next) {
206 >                                                double  nf = 1.-rbf->invec[2]*rbf->invec[2];
207 >                                                if (nf > FTINY) {
208 >                                                        nf = sqrt((1.-invec[2]*invec[2])/nf);
209 >                                                        invec[0] = nf*rbf->invec[0];
210 >                                                        invec[1] = nf*rbf->invec[1];
211 >                                                }
212                                                  return(0);
213 +                                        }
214                                  break;
215                          }
216                  }
# Line 247 | Line 254 | e_advect_rbf(const MIGRATION *mig, const FVECT invec)
254          double          t, full_dist;
255                                                  /* get relative position */
256          t = acos(DOT(invec, mig->rbfv[0]->invec));
257 <        if (t < M_PI/GRIDRES) {                 /* near first DSF */
257 >        if (t < M_PI/grid_res) {                /* near first DSF */
258                  n = sizeof(RBFNODE) + sizeof(RBFVAL)*(mig->rbfv[0]->nrbf-1);
259                  rbf = (RBFNODE *)malloc(n);
260                  if (rbf == NULL)
# Line 256 | Line 263 | e_advect_rbf(const MIGRATION *mig, const FVECT invec)
263                  return(rbf);
264          }
265          full_dist = acos(DOT(mig->rbfv[0]->invec, mig->rbfv[1]->invec));
266 <        if (t > full_dist-M_PI/GRIDRES) {       /* near second DSF */
266 >        if (t > full_dist-M_PI/grid_res) {      /* near second DSF */
267                  n = sizeof(RBFNODE) + sizeof(RBFVAL)*(mig->rbfv[1]->nrbf-1);
268                  rbf = (RBFNODE *)malloc(n);
269                  if (rbf == NULL)
# Line 332 | Line 339 | advect_rbf(const FVECT invec)
339                  return(NULL);
340          if (miga[1] == NULL) {                  /* advect along edge? */
341                  rbf = e_advect_rbf(miga[0], sivec);
342 <                rev_rbf_symmetry(rbf, sym);
342 >                if (single_plane_incident)
343 >                        rotate_rbf(rbf, invec);
344 >                else
345 >                        rev_rbf_symmetry(rbf, sym);
346                  return(rbf);
347          }
348   #ifdef DEBUG

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines