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

Comparing ray/src/cv/bsdfrep.c (file contents):
Revision 2.7 by greg, Thu Nov 8 22:05:04 2012 UTC vs.
Revision 2.8 by greg, Fri Nov 9 02:16:29 2012 UTC

# Line 188 | Line 188 | rotate_rbf(RBFNODE *rbf, const FVECT invec)
188          FVECT                   outvec;
189          int                     pos[2];
190          int                     n;
191 < #ifdef DEBUG
192 <        double  tdiff = 180./M_PI*fabs(acos(invec[2])-acos(rbf->invec[2]));
193 <        if (tdiff >= 1.5)
194 <                fprintf(stderr,
195 <                        "%s: Warning - rotated theta differs by %.1f degrees\n",
196 <                                progname, tdiff);
197 < #endif
191 >
192          for (n = rbf->nrbf; n-- > 0; ) {
193                  ovec_from_pos(outvec, rbf->rbfa[n].gx, rbf->rbfa[n].gy);
194                  spinvector(outvec, outvec, vnorm, phi);
# Line 221 | Line 215 | ovec_from_pos(FVECT vec, int xpos, int ypos)
215          double  uv[2];
216          double  r2;
217          
218 <        SDsquare2disk(uv, (1./grid_res)*(xpos+.5), (1./grid_res)*(ypos+.5));
218 >        SDsquare2disk(uv, (xpos+.5)/grid_res, (ypos+.5)/grid_res);
219                                  /* uniform hemispherical projection */
220          r2 = uv[0]*uv[0] + uv[1]*uv[1];
221          vec[0] = vec[1] = sqrt(2. - r2);
# Line 247 | Line 241 | pos_from_vec(int pos[2], const FVECT vec)
241   double
242   eval_rbfrep(const RBFNODE *rp, const FVECT outvec)
243   {
244 <        double          res = .0;
244 >        double          res = 0;
245          const RBFVAL    *rbfp;
246          FVECT           odir;
247          double          sig2;
# Line 497 | Line 491 | load_bsdf_rep(FILE *ifp)
491                                          sizeof(RBFVAL)*(rbfh.nrbf-1));
492                  if (newrbf == NULL)
493                          goto memerr;
494 <                memcpy(newrbf, &rbfh, sizeof(RBFNODE));
494 >                memcpy(newrbf, &rbfh, sizeof(RBFNODE)-sizeof(RBFVAL));
495                  for (i = 0; i < rbfh.nrbf; i++) {
496                          newrbf->rbfa[i].peak = getflt(ifp);
497                          newrbf->rbfa[i].crad = getint(2, ifp) & 0xffff;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines