Sequencer Bug: Camera Rotate

Howdy,

I set up a simple camera dolly and pan move. Essentially, the camera moves from a 3/4 angle on one side of a character who is standing still to the other side with the lens pointing at the face of the character the entire time. According to the info on the beginning and end keyframes, the camera has rotated on the Z axis from -160 to 163 degrees. The resulting move has the camera spin all the way around before landing on it’s end spot, instead of a small pan to stay locked on the character.

The camera move was done within the editor. The solution was to then go into the sequencer and manually change the end z rotation value to a matching negative value.

-Sterling

1 Like

Hey SterlingY,

We have an existing bug report for this(UE-22228) and I’ve added your observations as well. I’m hoping to bump the priority on this considering it works in Matinee.

-.

1 Like

Hello,

I think the issue SterlingY is finding is actually gimbal lock or related to it, and also a difference between angles and quaternions in math, and the fact that you guys should be doing a spherical interpolation instead of a linear one (and using quaternions behind the scenes, instead of angles).

First off, imagine your camera makes a small rotation of 10 degrees. It will go from -5 to +5 on the Z axis. Making a linear interpolation will give you the result you want (-5,-4…0,…5) and take the shortest route. On the other hand, suppose you want to make the exact same movement, but with the camera going from -360 to 5. It is essentially the same case, ej: you may want to take the shortest path and only do a 10 degree rotation. 5 degrees can also be expressed as -370 (it will point in the same direction in both cases). But you will see your camera messing up because there is no -370 angle. What you will see is the linear interplation of -360, -359, etc going all the way back to 5 and passing trough 0. Meaning your camera will make a full rotation (taking the longest route).

Also to complicate matters, in 3D, the order in which you apply your rotations (ej: first apply x, then y, then z), matters a lot. Changing this order will give you different orientations for the same values on x, y and z. There is an inherent ambiguity in the meaning of an orientation as expressed in angles. So you always have a fixed order hard coded in the program (ej, the program selects the option that it thinks fits, eliminating the ambiguity, but that option might not have been the one the animator wanted). The last axis in this order (namely, the z axis) is the one that will always be presenting a breaking axis (seen as a hard break in the rotation graph) or bad interpolations, and not necessarily on the -360 and 0 limit, but on other points as well (commonly every 180 degrees).

That is called gimbal lock, and I urge you guys to look into it for your implementation of cameras in sequencer. This is a common problem in 3D animation. I have seen it happen for example in After Effects or C4D. And there are fixes for it, namely using quaternions instead of angles and allowing the user to select the up vector (more of that in a moment).

Quaternions don’t have that problem. There is no ambiguity or multiple interpretations on the orientation represented by a quaternion, making them ideally suited for 3D graphics. They are not as intuitive to the user, but can be converted back and forth for display and user interaction (so the user only sees angles in the front end).

Linear interpolations are not a good way of interpolating orientations in 3D because of the case described in the beginning of the post. Spherical interpolations always take the shortest route and they should be what is used to interpolate rotations. Spherical interpolations or slerps need quaterions as inputs.

Matinee also had this problem of breaking axes and gimbal lock. But it had a checkbox on the camera track that said “use quaternions” that essentially used spherical interpolations instead of linears, the downside being that for some reason that disabled smoothing and only allowed linear temporal interpolation (making your animation feel bumpy). The reason behind that limitation is beyond me, because every other implementation I have seen (AE, Maya, C4D) allows for temporally smooth spherical interpolations, so I am betting your implementation could be better.

Now, there may be cases where you dont want the shortest route between two angles. You might actually want your camera to turn all around and not take the shortest route, so forcing you to use slerps will not make sense in every case. One alternative is what matinee used to do (putting in a checkbox that essentially allowed you to select lerp or slerp on a per-track basis) but that is limitting.

Other alternative and the best solution I can think of is to allow for angles lower than -360 and higher than 360. After Effects does this. It will represent angles as x(rotations) + (degrees). So, 10 degrees would be 0x + 10, 360 degrees would be 1x + 0, and 480 degrees would be 1x + 120. It is legible to the user and keeps being so even tough you might input a crazy angle with thousands of units.

Lastly, the problem of gimbal lock is best solved when you allow the user to define what axis he wants as the up vector. That gives the user the most power and versatility around the problems inherent in the gimbal lock.

Sequencer can be an incredible tool. It is already, in many ways, leagues ahead of matinee. But the camera control outside of a rig is still problematic, has always been so, and without even the partial solutions of the use quaternions checkbox, it seems even worse.

Please, please, please, I urge you, guys. Give us control over the way our camera interpolates orientation. If you want to put sequencer cameras as a tool on par of those of 3D suites, you must solve this problem. And it is as simple as using spherical interpolations when needed, allowing us to make full rotations and angles outside the 360 degree range, and allowing us to select a custom up vector for the cinematic camera actor.

I hope this information helps in some way to improve sequencer.

1 Like

Hi Diego,

I’ve forwarded some of your concerns to a dev. However, I’d like to note that this user’s issue is not related to gimbal lock. Thanks for posting some suggestions though.

-.

Here is my take on it:
https://forums.unrealengine.com/showthread.php?142610-Trcik-to-get-camera-to-rotate-past-180-degrees-in-Sequencer

has this been resolved?? we are having the same issue. The camera doe not rotate as needed . It always rotates in a anticlockwise fashion only allowing us to animate the camera turning right and not left

Hi. What worked for me is that you set the transforms for the cine camera INSIDE the Sequencer interface window. Don’t try and drag the camera in the viewer with its widget around. Set the numbers manually and it should be fine.

This is what I mean

1 Like

Yes thank you all. If you rotate via the sequencer it works as intended.

If anyone is still running into this problem, it was fixed very easily for me by editing the rotation animation in the curve editor - here you can easily drag the keyframes beyond the 180 degree limitations of the viewport…

Brilliant. Thanks for that last tip, this issue has been driving me nuts.

Thank you, it helped!

Wow this actually fixed it!! Probably because you can put the Z value higher than 360 or whatever but when you are piloting it and using those transforms you are limited to them.
If you have your camera on pilot you can still See where you’re dragging it around making it suprisingly easy by just increasing/decreasing those values.

Wow… this issue is still around. I was just prepping for a training session in Sequencer and the second keyframe I created using ‘s’ made the camera rotate on Z like 3 times inbetween. So no, this is still a thing in 4.22.3.

Yeah… mine happened while piloting a camera… very simple rotate move. I can fix these in the graph editor but they should never happen imo.

I got around it by using the rotate transform inside the Sequencer UI (not using the widget in the viewer). Its harder to get it accurate but it works. :slight_smile:

It has to do with the algorithm they use for the rotation and why they chose the ne they are using. Here is more info: Gimbal lock - Wikipedia

Is there a fix for this yet? Its still happening in UE5 for me, even manually editing it in sequencer doesnt work, the camera just spins when i try to rotate just slightly

1 Like