img1

What Is the Matrix? It's More Than Just a Movie

‌‌
Moving objects in 3D space is normally an intuitive process. You choose a transform manipulator which gives you interactive control over an object's position, rotation and scale. This lets you place the object where you'd like it to be. You may need to keep an eye on the object's offset values for those times when you're animating an object or creating a rig to drive the values of objects or nodes using the values of other objects or nodes. What regulates object transformations? More importantly, how can this information be beneficial to you?  This article will answer these questions as you learn what "the matrix" is.

The Transformation Matrix

transform When an object is transformed (i.e., moved, rotated or scaled in 3D space), the transform information (i.e., how much you moved, rotated or scaled the object) is stored in an internal table known as the transformation matrix. This data is extremely valuable because it allows you to keep track of an object's movements, whether in object space (local to its parent) or in world space. The transform matrix itself is hidden, but its data is accessible through transform properties. These properties display values you can modify to transform and animate objects.

Freezing Transformations

One very useful feature in 3D software is the ability to freeze an object's transformations. This will create a new reset position for the object to start from. Typically an object is transformed to a point in space that'd be an ideal starting location, and then it's transformations are frozen. The result is the object's current position, rotation and scale become the new reset transform state. The scale transformations are set to 100% when they're frozen. This makes it convenient to get back to the state it was frozen in by simply resetting its transform values. When you do this, the object's local matrix is reset according to the new position.

The World Matrix

world_matrix The world matrix still records the location in world space. This is advantageous when you're wanting to design rigs that execute certain procedures once the object is moved to a specific point in 3D space. Let's have a look at an example of this in action. Let's say you're working on a scene involving a character who'll cross a sensor to activate an alarm like in the screenshot above. In this hypothetical situation you've programmed the alarm to be activated once the parameter reaches a world space value of 110. The character's control rig can be frozen, so it's possible to reset it to get back to its starting pose in case any modifications must be made to either the rig or model. However, every control still has the world space position recorded. This means no matter what values have been used in order to animate the character crossing the sensor, the alarm will trigger only when one of the controls passed through this target area. Even though a control object might have a local value of 5 in one of its transform channels, its world-space value might be 105. This means, to activate the alarm, your control would actually need to be transformed to a value of 7, 10 or 15, depending on the character's scale.

Constraints

constrain Most industry-standard 3D animation packages include advanced constraining systems that allow you to attach the transformation matrix of an object to follow either another object or an object's transformations and even deformations. These object transformations are typically referred to as target objects, and the object being constrained is typically called the constrained object. Once an object is constrained, there are properties integrated within the constraint that allow you to either offset the constrained object or temporarily disconnect the object from its target object. What's really nice is you have access to animate these properties. That's usually necessary to have the constrained object move in a desirable fashion.

Constraint Limits

Although constraints are robust, they often have limits. These limitations are mainly noticeable when it comes down to controlling the rotation of an object. For instance, if the orientation of a constrained object isn't aligned to match the orientation of its target object before the constraint was applied, then the constrained object will tend to flip when the target object is rotated drastically (e.g., rotational values of 180 or greater). This is because the values recorded in the rotate list of its transform matrix become drastically different from the transform matrix of the target object influencing it. There are ways around these limitations. Usually these workarounds involve the use of utility nodes and a longer setup process, but it's well worth the extra setup time if your goal is to get passed this 180° limit.  Keep in mind that, in most cases, it's not necessary to rotate an object to that much of an extreme. So, unless you intend on animating a complex action that requires you to go beyond this limit, like a flip or a fall, then using a constraint can be ideal because it still offers great control with a faster setup process.   To sum it all up, an object's matrix records the transformation data in 3D. This is the position, rotation and scale. These matrices allow you to track and modify object transformations. That's necessary for repositioning and animating objects. You can keep learning how all of this works together in a real-world situation in the Pushing Your Rigs Beyond the Basics in Maya tutorial. Being mindful of this information can help you design  rigs that give you complete control over how an object is manipulated in 3D space. That's when things get really interesting.