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

Comparing ray/src/gen/mkillum4.c (file contents):
Revision 2.7 by greg, Wed Dec 12 05:09:58 2007 UTC vs.
Revision 2.9 by greg, Fri Jan 25 02:11:13 2008 UTC

# Line 277 | Line 277 | load_BSDF(             /* load BSDF data from file */
277          }
278          dp = (struct BSDF_data *)calloc(1, sizeof(struct BSDF_data));
279          for (wld = ezxml_child(fl, "WavelengthData");
280 <                                fl != NULL; fl = fl->next) {
280 >                                wld != NULL; wld = wld->next) {
281                  if (strcmp(ezxml_txt(ezxml_child(wld,"Wavelength")), "Visible"))
282                          continue;
283                  wdb = ezxml_child(wld, "WavelengthDataBlock");
# Line 377 | Line 377 | addrot(                        /* compute rotation (x,y,z) => (xp,yp,zp) */
377          char    **xfp = xfarg;
378          double  theta;
379  
380 +        if (yp[2]*yp[2] + zp[2]*zp[2] < 2.*FTINY*FTINY) {
381 +                /* Special case for X' along Z-axis */
382 +                theta = -atan2(yp[0], yp[1]);
383 +                *xfp++ = "-ry";
384 +                *xfp++ = xp[2] < 0.0 ? "90" : "-90";
385 +                *xfp++ = "-rz";
386 +                sprintf(bufs[bn], "%f", theta*(180./PI));
387 +                *xfp++ = bufs[bn++];
388 +                return(xfp - xfarg);
389 +        }
390          theta = atan2(yp[2], zp[2]);
391          if (!FEQ(theta,0.0)) {
392                  *xfp++ = "-rx";
# Line 432 | Line 442 | getBSDF_xfm(           /* compute BSDF orient. -> world orient.
442                  updir[2] = 1.;
443                  break;
444          case UDunknown:
435                error(WARNING, "unspecified up direction");
445                  return(0);
446          }
447          fcross(xdest, updir, nrm);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines