The object offset transformation provides an offset of the geometry of an object from its node. This section describes the object offset transformation and its function in 3ds Max.
One can see a node's pivot point graphically represented in 3ds Max by selecting a node, going to the Hierarchy branch of the command panel, selecting the 'Pivot' button, and choosing either the 'Affect Pivot Only' or 'Affect Object Only' button. This displays a large axis tripod that shows the location and orientation of the node's pivot point: the Node transformation matrix (INode::GetNodeTM()). By choosing one of these buttons, and using the Move / Rotate / Scale tool bar controls, a user can manipulate the position of the geometry of the object independent of the pivot point. Or they may manipulate the pivot point independent of the geometry of the object position. One can think of the geometry of the object as the 'mesh' of the object.
The way the user is able to independently manipulate the pivot and the object is managed internally using the object-offset transformation. The object-offset transformation affects how the geometry of the object is related to the node. The object-offset transformation transforms the geometry of the object itself some amount from the node.
To understand how the object-offset is used, consider the following example from the 3ds Max user interface. In the Hierarchy branch under 'Pivot', when the user has chosen the 'Affect Object Only' button they are free to move the geometry of the object around independent of the node. The pivot point does not move -- only how the geometry of the object is oriented relative to the pivot. What is happening internally is the object-offset transformation is being manipulated. This transformation is simply an additional offset that may be applied to the geometry of the object that is independent of the node. The object-offset transformation is not inherited by any child nodes.
As another example consider the use of the 'Affect Pivot Only' button. This mode lets the user move the pivot without affecting the position of the geometry of the object. When the system allows the user to move the pivot point, what is actually happening is the node's transformation is being altered (to re-orient the pivot point), then the object-offset transformation is adjusted to counter the node transformation. This lets the geometry of the object stay in the same place while the pivot point moves around. So again, when the user is moving the pivot point, 3ds Max is actually adjusting the node transformation matrix and counter-adjusting the object-offset transformation.
The object offset transformation consists of separate position, rotation and scale transformations. Like the node transformation, these are applied by pre-multiplying position, then rotation, then scale. Thus the object offset transformation is:
Object Offset Transformation = OffsetScale * OffsetRotation * OffsetPosition
Unlike the node transformation matrix, the object offset transformation is not inherited by children of the node.
The INode class has methods to get and set individual transformations of the object offset. These are:
Constructing an offset transformation matrix for a node can be done with the following code:
Matrix3 tm(1); Point3 pos = node->GetObjOffsetPos(); tm.PreTranslate(pos); Quat quat = node->GetObjOffsetRot(); PreRotateMatrix(tm, quat); ScaleValue scaleValue = node->GetObjOffsetScale(); ApplyScaling(tm, scaleValue);
The INode class has a set of methods that allow a developer to transform the node or geometry in the same way as the hierarchy 'Affect Pivot Only' and 'Affect Object Only' modes do. The entire node and object may be transformed, just the pivot, or just the geometry of the object. These methods are: