Download

Need help figuring some simple rotation changes.

Hello!

I am trying to rotate an actor based on the angle (360) of two 3d vectors.

So I stumbled on really cumbersome problem with rotations and the likes (I am not good with vector maths). I am trying to get the angle between two 3D vectors, where A is origin (0,0,0) and B is moving. I know that A(UpVector) and B = normalized > dot > acos(degrees) will give me the angle. But the problem is that its 0 - 180, the thing I want is continuously 360 rotation. I am sure that my workflow is bad, so how should I proceed here? Thanks in advance.

Here is BP screenshot of my workflow:

Its dirty but you can make a converter macro that simply adds 180 from the actual rotation value so you don’t have to mess with your setup.

You can’t define the angle of 2 arbitrary 3d vectors in a range from 0 to 360°. 2 arbitrary 3d vectors define their own axis of rotation that doesn’t have a fixed orientation. You cannot uniquely fix the direction of the angle.

But if you take a look at the vectors on the plane they’re both parallel to, they’re not arbitrary there. So you can uniquely define a direction of the angle within that plane but only within that plane. You’re projecting the 3d problem into a 2d problem there. And in that case you can get the direction of the angle by using the determinant of the 2 vectors.

I tried this, its not working really well or its not working well with my setup. :frowning:

Hmmmm, could you show me a simple example to this or give me some more directions. Thanks in advance.