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

Comparing ray/src/util/rsensor.c (file contents):
Revision 2.10 by greg, Thu May 19 16:09:38 2011 UTC vs.
Revision 2.12 by greg, Mon Sep 26 15:33:29 2011 UTC

# Line 470 | Line 470 | sens_val(
470          int     t, p;
471          
472          dv[2] = DOT(dvec, ourview.vdir);
473 <        theta = (float)((1./DEGREE) * acos(dv[2]));
473 >        theta = acos(dv[2]);
474          if (theta >= maxtheta)
475                  return(.0f);
476          dv[0] = DOT(dvec, ourview.hvec);
477          dv[1] = DOT(dvec, ourview.vvec);
478 <        phi = (float)((1./DEGREE) * atan2(-dv[0], dv[1]));
479 <        while (phi < .0f) phi += 360.f;
478 >        phi = atan2(-dv[0], dv[1]);
479 >        while (phi < .0f) phi += (float)(2.*PI);
480          t = (int)(theta/maxtheta * sntp[0]);
481 <        p = (int)(phi*(1./360.) * sntp[1]);
481 >        p = (int)(phi*(1./(2.*PI)) * sntp[1]);
482                          /* hack for non-uniform sensor grid */
483 +        theta *= (float)(1./DEGREE);
484 +        phi *= (float)(1./DEGREE);
485          while (t+1 < sntp[0] && theta >= s_theta(t+1))
486                  ++t;
487          while (t-1 >= 0 && theta <= s_theta(t-1))
# Line 542 | Line 544 | comp_sensor(
544                                  continue;
545                          }
546                          rr.rmax = .0;
547 <                        rayorigin(&rr, PRIMARY, NULL, NULL);
547 >                        rayorigin(&rr, PRIMARY|SPECULAR, NULL, NULL);
548                          scalecolor(rr.rcoef, sf);
549                          if (ray_pqueue(&rr) == 1)
550                                  addcolor(vsum, rr.rcol);
# Line 558 | Line 560 | comp_sensor(
560                          continue;
561                  }
562                  rr.rmax = .0;
563 <                rayorigin(&rr, PRIMARY, NULL, NULL);
563 >                rayorigin(&rr, PRIMARY|SPECULAR, NULL, NULL);
564                  scalecolor(rr.rcoef, sf);
565                  if (ray_pqueue(&rr) == 1)
566                          addcolor(vsum, rr.rcol);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines