I solved my issue.
My solution was this :
- Use
Quaternion.AxisAngle(angle : float , rotationAxis : Vector3)
;
so for example, to rotate around "local" x, the rotationAxis
should be myVector's perpendicular, which is computed like this :
var rotationAxis : Vector3 = Quaternion.Euler(0,90,0) * myVector;
rotationAxis.y = 0;
then the new quaternion is computed like this :
var localEuler:Quaternion = Quaternion.AngleAxis(euler.x , rotationAxis);
then the vector is rotated correctly :
myVector = localEuler * myVector;