|
![](/i/fill.gif) |
Being dissatisfied with Point_At_Trans and Reorient_Trans, for use in my
inverse kinesics skeleton, I decided to break out the math and try to
write a replacement. And I ended up with this macro:
#macro Point_To(tvector)
#declare rho = sqrt (
abs (tvector.x * tvector.x) +
abs (tvector.y * tvector.y) +
abs (tvector.z * tvector.z)
);
#declare sigma = sqrt (
abs (tvector.x * tvector.x) +
abs (tvector.y * tvector.y)
);
#declare phi = degrees(acos (tvector.z / rho));
#if (tvector.x < 0)
#declare theta = 180 - degrees(asin (tvector.y / sigma));
#else
#declare theta = degrees(asin (tvector.y / sigma));
#end
#if
<90 - phi, 0, theta - 90>
#end
No doubt someone could make use of this. :)
Post a reply to this message
|
![](/i/fill.gif) |