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"); |
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"; |
442 |
|
updir[2] = 1.; |
443 |
|
break; |
444 |
|
case UDunknown: |
435 |
– |
error(WARNING, "unspecified up direction"); |
445 |
|
return(0); |
446 |
|
} |
447 |
|
fcross(xdest, updir, nrm); |