512 |
|
nd.vray[1] = -r->rdir[1]; |
513 |
|
nd.vray[2] = -r->rdir[2]; |
514 |
|
ec = SDmapDir(nd.vray, nd.toloc, nd.vray); |
515 |
– |
} |
516 |
– |
if (ec) { |
517 |
– |
objerror(m, WARNING, "Illegal orientation vector"); |
518 |
– |
return(1); |
515 |
|
} |
520 |
– |
ec = SDinvXform(nd.fromloc, nd.toloc); |
521 |
– |
/* determine BSDF resolution */ |
516 |
|
if (!ec) |
517 |
< |
ec = SDsizeBSDF(nd.sr_vpsa, nd.vray, NULL, |
524 |
< |
SDqueryMin+SDqueryMax, nd.sd); |
517 |
> |
ec = SDinvXform(nd.fromloc, nd.toloc); |
518 |
|
if (ec) { |
519 |
< |
objerror(m, WARNING, transSDError(ec)); |
527 |
< |
SDfreeCache(nd.sd); |
519 |
> |
objerror(m, WARNING, "Illegal orientation vector"); |
520 |
|
return(1); |
521 |
|
} |
522 |
+ |
/* determine BSDF resolution */ |
523 |
+ |
ec = SDsizeBSDF(nd.sr_vpsa, nd.vray, NULL, SDqueryMin+SDqueryMax, nd.sd); |
524 |
+ |
if (ec) |
525 |
+ |
objerror(m, USER, transSDError(ec)); |
526 |
+ |
|
527 |
|
nd.sr_vpsa[0] = sqrt(nd.sr_vpsa[0]); |
528 |
|
nd.sr_vpsa[1] = sqrt(nd.sr_vpsa[1]); |
529 |
|
if (!hitfront) { /* perturb normal towards hit */ |