Answers for "Quaternion rotations don't add up"
http://answers.unity.com/questions/579667/quaternion-rotations-dont-add-up.html
The latest answers for the question "Quaternion rotations don't add up"Answer by meat5000
http://answers.unity.com/answers/579730/view.html
The rotations in Q-Euler are around the world axes I believe (in the order z, x, y). Work through with this on paper and you'll probably find it's correct. On paper treat Vector x as a point in space.
Place a cube at the point in space determined by your x vector. Apply the two rotations you created to the cube via script and you will see the same results.
Place the following onto a script and place it on a cube with position 13,4,5. It simply performs each rotation one axis at a time so you can see whats going on a bit better.
#pragma strict
var timer : float = 0.0;
var stage1 : boolean = true;
var stage2 : boolean = true;
var stage3 : boolean = true;
var stage4 : boolean = true;
var stage5 : boolean = true;
var stage6 : boolean = true;
function Update()
{
timer += Time.deltaTime;
if (timer >= 3.0 && stage1)
{
transform.position = Quaternion.Euler(0,0,350) * transform.position;
stage1 = false;
}
if (timer >= 6.0 && stage2)
{
transform.position = Quaternion.Euler(180,0,0) * transform.position;
stage2 = false;
}
if (timer >= 9.0 && stage3)
{
transform.position = Quaternion.Euler(0,300,0) * transform.position;
stage3 = false;
}
if (timer >= 12.0 && stage4)
{
transform.position = Quaternion.Euler(0,0,10) * transform.position;
stage4 = false;
}
if (timer >= 15.0 && stage5)
{
transform.position = Quaternion.Euler(180,0,0) * transform.position;
stage5 = false;
}
if (timer >= 18.0 && stage6)
{
transform.position = Quaternion.Euler(0,60,0) * transform.position;
stage6 = false;
}
}Wed, 20 Nov 2013 19:01:24 GMTmeat5000