A question for rotation experts (am talking to you Aldo or Mike!).
I have an aircraft flying in 3D space.
I wish to display an object on the minimap that is representative of this aircraft, but only rotated in 2D (y axis, fixed x and z).
I have written a script that works, but am not sure if this is the correct/optimal way of calculating this, as it works with the quaternions directly :
#pragma strict
var obj3d : Transform;
var obj2d : Transform;
var rot3d : Quaternion;
var rot2d : Quaternion;
function Update()
{
rot3d = obj3d.rotation;
rot2d = Quaternion( 0.0, rot3d.y, 0.0, rot3d.w );
obj2d.rotation = rot2d;
}
If there is a better method, please educate me !
=]