Euler (gimbal lock) Explained

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this tutorial we'll look at oiler rotations and gimbal lock to see how strange motion can occur in between keyframes in the last video we saw that oil rotations have a rotation order that can be changed with XYZ values we'll explore this further with a quick example of setting up the rotation order of an object to avoid gimbal problems so how does Euler work this gimbal machine shows us each part is linked to one another so when the parts slide around we can see how the rotations are passed on by spinning each of the machines three arms we can rotate the jet into any angle but notice when the jet points up how two of the circular arms match up this is exactly the same effective gimbal lock causing two circular arms to rotate on the same plane let's make this ourselves in a hierarchical system to demonstrate we'll grab some torus objects they can represent each axis Green will represent Y X will be red and said blue so altogether we have three Tauruses in the narrow object let's parent them together X to Y Zed to X and the arrow to Z this is going to mimic a rotation order of Y then X then Z the Y or green torus is at the top of our hierarchy so in this parent structure everything rotates with it said on the other hand effects the arrow because it's at the bottom of the hierarchy for the last axis in the rotation order X is second in the rotation order so it'll affect the Z below and see how Y stays still because it's at the top of the hierarchy now here's where things start to get interesting if we continue to rotate X in the middle of the hierarchy it'll cause y&z to a line here this rotation already hits Kimber lock when two axes align if we're animating and our next step is to turn the arrow down there's a problem because there's no access to turn on here's the missing axis in grey it's always possible to rotate our arrow into any new rotation but we'll have to rotate all three axes to achieve it let's undo this and rotate all axes at once notice how the arrow doesn't rotate in the straight direction instead it moves in an unexpected arc this is the cause of gimbal problems in animation because the object can move unexpectedly in between keyframes a solution is to use a different parenting structure this will change the arrows rotation order a new order will be y first then Z then X in our new hierarchy Y is still the parent but X and Z have been swapped now we can rotate the object without hitting gimbal lock in between the arrow rotates is expected but the gimbal problem doesn't go away it just changes with oil at gimbal lock will always occur in some situation there's just no way around it in this example gimbal lock still happens by turning the z-axis 90 degrees to cause the X and y axis to align in another parent structure the rotate order might be said first then Y then X now gimbal lock occurs when the y axis rotates 90 degrees altogether there are six parenting combinations to choose from in each case gimbal lock occurs on the axis of the parent when the mill axis is rotated too far let's explore this in a real animation situation here's a 3d camera we'll use the 3d software Maya as our example in Maya the rotation order is written backwards in this case Z is the parent Y is below and X is the child Zed here represents the roll or Bank of an object in this order Z is at the top of the hierarchy y is in the middle so when it's rotated it won't affect said this axis can be referred to as your heading or pen the bottom of the hierarchy is X and in this example it's pitch or tilt as soon as the camera looks sideways we achieve gimbal lock this isn't good especially considering that the camera will frequently look to the side in this scenario it's difficult to roll the camera because Zee our roll axis has been aligned with X our tilt axis if we switch to local object rotation mode our manipulator will snap to the intuitive way of rotating the camera but remember that this is only a visual guide it simply makes it easier for us humans to rotate the camera under the hood the software package is still using the Euler system even if it doesn't appear that way to demonstrate let's roll the camera a little now we'll switch back to the Euler rotations and see what's actually happened under the hood as we can see the software in this case Maya has rotated the object with Euler rotations in fact it's always calculating in Euler whether we like it or not it's done this automatically and behind the scenes matching how we turn the object using our local object manipulator Euler is actually the correct display of how the computer sees the object in this case our cameras rotation and this is all ok until we go back to the camera rotation before it was rolled in this animation example the camera isn't rolling on one axis it's actually changing the values of two axes at once this causes the camera to skew strangely in its rotation and not just roll along its length let's reset and see if we can find a better rotation order with any object the key is to find a rotation order that has the least chance of hitting gimbal so the trick here is to find the direction that the object is least likely to face in this case a camera rarely looks up or down so we'll make the parent axis why a camera usually doesn't Bank much either so we want the bank axis or Z to be the child so in Maya a good camera rotation order is y as the parent X and then Z now when we look sideways we have no gimbal the camera can tilt up and we can still Bank the camera without any hiccups even in situations where the camera looks up this rotation order still works well we'll finish with this example a camera tracking up to follow a ball
Info
Channel: GuerrillaCG
Views: 1,033,154
Rating: 4.9080725 out of 5
Keywords: gimbal, euler, quaternion, rotation, learn, 3d, cg, cgi, tutorial, education, guerrilla, computer graphics, animation, rigging, training, maya, 3ds max, xsi, blender, lightwave
Id: zc8b2Jo7mno
Channel Id: undefined
Length: 8min 6sec (486 seconds)
Published: Wed Jan 14 2009
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.