Download

Math help - Rotation in direction.

Hello, I am trying to create a rotation in a certain direction, is the best way I can describe it…
I think the best way to explain it is by using an armature… though note that its not an actual object that receives the rotation.
All in world space.

I have a float curve which should determine the rotation: (side view)
armdeg.png

And the reason I find this difficult is that the rotation should depend on a direction vector (normalized): (each arm represents a direction)
fdd804f01ac7ee01c7776e9805daf31b6aa2184c.png

This is how the direction vector is set:

35fe8c2628cf32bc6a000ec196b6870859d2b828.png

And in the below picture:
X is the desired distance to set the object in the direction of a vector depending on the Z value (the float curve).
Of course, in that picture it only rotates in world Y axis. I just don’t know how to math it together with the direction vector.

Any help is appreciated.