Rotation Problem

Hi! I’m working on a Compositing Tool. The UI is mostly done with sliders. The tool got a Camera, which can be rotated around all 3-axis with the sliders. After that, there should be the possibility to rotate the “final picture” between -90 and 90 degrees. Again with a slider.

My Idea was to go the hierarchy one step down and use an empty actor that holds the camera. So for the rotation of the final picture i need to rotate the empty actor around the optical axis of the camera… Here my BP Setup:

This works fine as long as i use small angles, the Forward Vector of the camera isn’t changing like supposed. If i move the slider to the end, it goes crazy and the Forward Vector changes to strange values. And even the Angle don’t change at the end of the slider, as long as i move the mouse it calculates a new Forward Vector for the camera…

Moving the slider fast forwards and back at a relatively high angle value cause the same error… Take a look at the video:

So I’m not sure if this is a bug or a thinking error of me… Anybody got an idea for a solution to this or a workaround?

Is the camera forward vector parallel to the actor forward vector or is there a relative rotation between the two? Looks like gimbal locking to me, but I am not sure why on the positive side it happens at 90 degrees while on the negative side it seems to happen a bit before -90.

There is a relative rotation between the two vectors. The Camera is free to rotate around 3 axes. The Actor is only free to roll, and this restricted to only around the optical axis (Forward Vector) of the camera… So gimbal locking can maybe causing the problem. But on the other hand the problem occurs before reaching the +/- 90 degrees (it happens on both sides, i tried to keep the video short…), and this most noticeably by moving the slider fast forward/backwards in a little range… The “Get Forward Vector” Node of the camera starts to change (very little) before reaching 90 degrees.

Can you try to lock the relative rotation of the camera respect to the actor and just have the actor’s roll adjusted through the slider? Do you still get the weird behavior when approaching +/-90 degrees?

Just had a long discussion in this other thread here: Make rotator / make transform - problem with incorrect values - Unreal Engine Forums

There seems to be an issue on chains of rotations where, after a certain number and especially close to certain angles (90 degrees and multiple), the transformation error keeps increasing. Not 100% sure it is related also to your case though.

Hey, sorry i have to work also on another project…
I’m not sure what you mean with the lock part… Right now the camera rotation is fixed at some random values for pitch and yaw… When there are no rotations in the Camera(0,0,0), then the Roll of the Actor works without problems…

I had some similar problems at the beginning of my work with ue4… As you can see in this video the Problem starts at 90 Degrees and somehow even if the input value for the Rotation is >90, the Object Transform Rotation does not go over 90…

I think i maybe have to calc the rotation on my own?