Just rotate each of these vectors at the same angle your object rotates. Let's say you rotate around the z axis (i.e. (0, 0, 1))
The equations will be:
x' = x cos(angle) + y sin(angle) y' = -x sin(angle) + y cos(angle) z' = z
Your up vector is (0, 1, 0), thus;
x' = 0 * cos(angle) + 1 * sin(angle) = sin(angle) y' = -0 * sin(angle) + 1 * cos(angle) = cos(angle) z' = 0
Forward vector (0, 0, 1), like this:
x' = 0 y' = 0 z' = 1
It will not rotate, since we rotated around the z axis, which is the parellel for your vector forward
source share