From the course: Maya: Camera Techniques

Setting rotate axis order - Maya Tutorial

From the course: Maya: Camera Techniques

Setting rotate axis order

- [Instructor] Let's go a little bit deeper into setting up a camera for animation by setting its rotation axis order, and that'll prevent any problems with animation or camera rotations. And the previous movie, we saw how to use gimbal mode to set the rotate manipulator so that it will directly correspond to the channel box values. Let's look at that once again, if I select the camera, double click on the rotate tool, if I'm in gimbal mode and for example, I rotate around Y then we're going to change the Y axis. If I rotate around X, we're going to change the rotate X axis, right? I'll set all those back to zero, select those and type in a zero and press enter. If we set access orientation to any other mode, we're going to be using a temporary frame of reference. That's not actually the real rotation space of the object. For example, if I choose object access orientation, and then tilt down and then rotate around the Y axis. Watch what happens over here in the channel box, all three of those rotation values change. That's just an illustration that the access orientation is a temporary frame of reference. If we rotate around object Y in this case, or actually rotating around all three axes in the true space of the object, which is the parent, which in this case is the world, since the object has no parent. Okay, so if we use gimbal mode, then what you see is what you get, when you rotate around one axis, you know for sure, you're only going to rotate around that axis. I'm going to set all these back to zero, select all those in type in a zero, and mentioned that even if you're in some other access orientation such as object, you can use the channel box virtual sliders and avoid any problems. You can just completely not use the manipulator at all. In fact, we can go to the select tool or any other tool and highlight one of these channels, such as rotate X and middle mouse drag in the viewport. And we're tilting up and down around the X axis. Likewise, we can choose Y we can pan around left to right only in Y, okay, I'll set those all back to zero. So that's, if you don't want to use the manipulator, but you probably do want to use that manipulator and use it a lot, the channel box sliders do work, but it's not really the most intuitive method. As you see, when we rotate around, for example, the Y axis in gimbal mode, the red X axis will follow as we rotate, the blue Z axis does not follow. And that's kind of an indicator that there is an order of operations, rotations in 3D follow a hierarchy of access rotations. It has to do with the order, which each one of these rotations is performed. If you rotate around X first, then Y then Z you'll get a different result if you use the same values, but just perform the operations in a different order. The operations are not all performed at the same time. There's actually an internal hierarchy. You can think of it just like a parent child relationship. And as I rotate around why we see that X follows, we could say that X is a child of Y, but Z does not follow. It appears that Z is not a child of Y. If we rotate around Z, we see that both X and Y are following. So it appears that the order of operations here is that the Z axis is the parent. And the Y axis is a child of Z. And the X axis is a child of Y. If we rotate around X, we don't see the other axes move. Okay, so that tells us that the default access orientation is actually X, Y, Z. I'll set this back to zero. That's investigate with that camera selected. We'll go into its attributes control A, and we want to be in the camera's transformed node. And here's the rotate order and set to X, Y, Z. And that kind of sounds like the opposite of what we expect, because Z here is the ultimate root of this little system. We would expect it to be the first in the list here, but it's actually reversed Z as last. What we want to do here is ensure that we don't get a Dutch tilt accidentally. We want to set the rotate order optimally for a camera. The camera's going to pan a lot. So the Y axis really is the most important one. It's going to tilt less than it pans. So that X axis is less important. And it's almost never going to roll or do a Dutch tilt, which is the Z axis. So the Z axis is the least important. And that tells us that the ultimate parent of our system here really should be the Y axis followed by X, followed by Z. And remember that the rotate order listing here is reversed. And using that information, I can determine that the optimal rotate order is Z, X, Y, Z being the child X, being a parent of Z, and Y being a parent of X, we'll set the rotate order to Z, X, Y, and we can get rid of the attribute editor now, restore all these back to zero once again and test it. So if we rotate around Z, we get a Dutch tilt and the other two axes don't follow. That means Z is not a parent of anything. I'll undo that and with the Z key, when we rotate around X and it's tilting up and down, we see that the Z axis follows. So it looks like Z as a child of X, I'll undo that with the Z key, and finally rotating around Y, we see the other two axes follow, X as a child of Y and Z as a child of X, and having set it up this way, we can now do anything we want, and we're never going to get a problem with a Dutch tilt, unless we deliberately introduce it by rotating around the Z axis, but normally you'll want the Z axis to be set to zero, okay, by working in gimbal mode and sending the rotate order to Z, X, Y, and we will have no problems with our camera, we don't need to build any kind of specialized rig. We can pretty much do anything that we need to do, including pan tilt and Dutch tilt. We can animate all of those rotations and not incur any issues.

Contents