I am trying to calculate the tiltAngle, and panAngle of an object for the HoverController, and am not
too sure where I am going wrong:
var obj3D : ObjectContainer3D = getMarker( id );
var r:Number = Math.sqrt( ( obj3D.z * obj3D.z ) + ( obj3D.y * obj3D.y ) + ( obj3D.x * obj3D.x ) )
var theta:Number = (Math.acos(obj3D.position.y / r))/(Math.PI/180);
var phi:Number = (Math.atan2(obj3D.position.z, obj3D.position.x))/(Math.PI/180);
cameraController.tiltAngle = theta;
cameraController.panAngle = phi;
cameraController is a HoverController…
any help is appreciated
Thanks
Karim