29.11.2016, 21:25
I am not sure what you mean with
vector along X axis
vector along Y axis
vector along Z axis
Usually if you have a rotation you can get the forward, right or up vector, for XZY it should be
Right Vector
X = cos(pitch) * cos(roll)
Y = sin(yaw) * sin(roll) + cos(yaw) * cos(roll) * sin(pitch)
Z = cos(pitch) * sin(yaw) * sin(pitch) - cos(yaw) * sin(roll)
Forward Vector (roll doesn't matter)
X = -sin(pitch)
Y = cos(yaw) * cos(pitch)
Z = cos(pitch) * sin(yaw)
Up Vector
X = cos(pitch) * sin(roll);
Y = cos(yaw) * sin(pitch) * sin(roll) - cos(roll) * sin(yaw);
Z = cos(yaw) * cos(roll) + sin(yaw) * sin(pitch) * sin(roll);
Source: https://en.wikipedia.org/wiki/Euler_...otation_matrix
vector along X axis
vector along Y axis
vector along Z axis
Usually if you have a rotation you can get the forward, right or up vector, for XZY it should be
Right Vector
X = cos(pitch) * cos(roll)
Y = sin(yaw) * sin(roll) + cos(yaw) * cos(roll) * sin(pitch)
Z = cos(pitch) * sin(yaw) * sin(pitch) - cos(yaw) * sin(roll)
Forward Vector (roll doesn't matter)
X = -sin(pitch)
Y = cos(yaw) * cos(pitch)
Z = cos(pitch) * sin(yaw)
Up Vector
X = cos(pitch) * sin(roll);
Y = cos(yaw) * sin(pitch) * sin(roll) - cos(roll) * sin(yaw);
Z = cos(yaw) * cos(roll) + sin(yaw) * sin(pitch) * sin(roll);
Source: https://en.wikipedia.org/wiki/Euler_...otation_matrix

