Quaternion to matrix rotation only one axis
问题 I have a quaternion that contains the rotation of the three axes (x, y, z) at the same time. I want to convert this quaternion to a rotation matrix but only the rotation on the Y axis of the quaternion or of any of the other axes, without all three at the same time. 回答1: A possible route: Transform unit vectors X=(1,0,0) and Z=(0,0,1) by the quaternion Call these rotated vectors (x0,x1,x2) and (z0,z1,z2) If the rotation would have been purely around Y, we would have: (x0,x1,x2) = (cos(theta),