|
|
Am 2017-05-29 15:42, also sprach dick balaska:
> I'm trying to master converting a vector to an angle in 3D
Of course I figured it out after finally asking:
// Convert this vector into its angle
#macro VtoA(V)
#local _V=vnormalize(V);
#local rZ=degrees(acos(_V.z));
#local rY=0;
#if (_V.y != 0)
#local rY=degrees(atan2(_V.x,_V.y));
#end
#debug concat("rY/Z=", str(rY,0,2), ", ", str(rZ,0,2), "\n")
<-rZ,0,-rY>
#end
--
dik
Post a reply to this message
|
|