Download

Axis-angle rotation to Yaw/Pitch/Roll in UE4

Hello everybody,
I’m quite new to UE4 BP programming so bear with me if I’m asking a stupid question. I took some time to look around the internet but didn’t find an answer so far.

Issue:
I’m receiving some rotation value from an external software to UE4 in an Axis-angle representation: Wikipedia Axis-angle.
I would like to know how I can convert those values within a Blueprint to a rotator that can be used to influence an actor or mesh (Yaw, Pitch, Roll).

**What I know so far: **
From what I understand, the Axis-angle representation will encode the direction of rotation as a vector and the angle value as the vector length.
I’ve discovered this node: Rotator from Axis angle but I’m not sure on how to split my vector to get an axis and an angle separately.

Any help will be appreciated,
Thank you for your time :smiley:

Solution #1: Extract the angle using VectorLength (you may need to convert the radians to degrees) and the axis using Vector Normalize
It was mostly working but we’ve experienced some weird behavior with the way rotators is made in UE4 so we moved to solution #2

Solution #2: Create your own Quaternion