# Changing a direction Vector with Euler angles

It seems like an easy problem but I somehow didnt got to the solution. I need the Maths to change the Vector based on Euler angles.

Example Problem:

I have an direction Vector- for example: Showing Forward: (0,0,1)

I have 3 Euler Angles (X,Y,Z) for example like this: (0°,180°,0)

Which means: It rotates back -

Now if I add that to the direction Vector- I want my direction Vector to show Backward (0,0,-1)

I tried last night and did not came up to a solution how to do the maths for this.

Anyone here knows the math to solve this?

For special cases where the vector is aligned with one of the coordinate axes (like your (0, 0, 1) example), it suffices to compute just one column of the transformation matrix, and scale it by the nonzero component of your vector to generate its transformed version - so that can be a shortcut if you only care about one or two axes. Similarly, we can simplify the matrix math if you know in advance that one of your angles will always be zero or some other constant.