Note that there are some explanatory texts on larger screens.

plurals
  1. PO3D Z-Y-X rotation of vector
    primarykey
    data
    text
    <p>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.</p> <p>The matrix I use can be found on wikipedia (<a href="http://en.wikipedia.org/wiki/Euler_angles" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Euler_angles</a>). It's located slightly below the middle of the page in the list of transformation matrices. I'm using the ZYX one: <img src="https://i.stack.imgur.com/Hzntd.png" alt="enter image description here"></p> <p>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:</p> <pre><code>[ 0.5 -0.707 0.5 ] [ 0.5 0.707 0.5 ] [ -0.707 0.0 0.707 ] </code></pre> <p>Now I multiply it by the following vector:</p> <pre><code>[ 10 ] [ 0 ] [ 0 ] </code></pre> <p>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.</p> <p>However, both my matrix class and all other programs give me this vector as result:</p> <pre><code>[ 5 ] [ 5 ] [ -7.07 ] </code></pre> <p>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</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload