I'm trying to rotate a vector in 3 dimensions by creating a rotation matrix from the world to the new rotation. I do the rotation by first rotating around the Z axis, then the Y axis and lastly the X axis using right hand notation.
The matrix I use can be found on wikipedia (http://en.wikipedia.org/wiki/Euler_angles). It's located slightly below the middle of the page in the list of transformation matrices. I'm using the ZYX one:
I now create it with a Z rotation of +45 degrees, a Y rotation of +45 degrees and no X rotation. This gives me the following matrix:
[ 0.5 -0.707 0.5 ]
[ 0.5 0.707 0.5 ]
[ -0.707 0.0 0.707 ]
Now I multiply it by the following vector:
[ 10 ]
[ 0 ]
[ 0 ]
As can be seen it's a 10 unit long vector along the x-axis. I expect the rotated result to be around 6 in the x, y, and z field (with z being negative) as that gives a vector of roughly length 10. Ie the vector is rotated first exactly between the world x and y axis (the first z rotation) and then angled down from there another 45 degrees ending up exactly between the x-y plane and the negative z axis (the second y rotation). In my mind this means three equally long unit vectors representing this vector.
However, both my matrix class and all other programs give me this vector as result:
[ 5 ]
[ 5 ]
[ -7.07 ]
It seems correct as the length of it is 10 as expected. So the question is where am I wrong? I'm sure I'm making some stupid thought error somewhere obvious, because it sure doesn't have three equally long arms :p