Vector property missing when translating RSL to OSL
anders.steen98@...
This was originally posted in the RenderMan forum, but I think someone here might know the answer, so I'll try posting here.
where ssOutDir is a vector and thOutPrime is a float. |
|
Larry Gritz
In the original RSL, there were no structures, and "." was appropriated to be the dot product operator! (We later came to regret that once the utility of structures was evident.) So I think what you want is thOutPrime = asin(dot(ssOutDir, axis)); (This was the second response I wrote to your email, the first being just totally perplexed and begging to see the declaration ofssOutDir. Then I started thinking about the "asin" and why anybody would ever take the component-by-component asin of a vector, that made no sense. Then just before I hit "send", I realized that asin is useful for computing the angle between two vectors from their dot product... and it all fell into place.)
|
|