Http://blog.csdn.net/Nhsoft/article/details/241629
Inode is an important part in the max SDK. Almost all things need to be accessed through inode: mesh camera and so on.
Next, I will briefly introduce various inode-related TM. (transformation matrix). It only represents my understanding of the Max SDK.
First, we will introduce node and object (mesh triobject ).
The scene in Max is composed of inode, which contains many things. This node may be deform (deformation) or deform. For example, common editable mesh and cylinder types can be deform nodes, while camera cannot deform.
The ry in a node (which can be converted to geomobject) that contains a geometric object is not the node itself. but the object in node. this object may be a derived object (indicating that this object is derived from other objects, usually derived from the result of the last modifier (modifier ). in addition, some modefier values are appended. Each modifer's Modification result is a deried object. the modifier similar to pyhsique applies to the derived object. therefore, to find a node with a pyhsique modifier, you need to get it through derived object.
Inode-> getobjectref ()You can get the object of this object.
Object-> superclassid () = gen_derived_class_idThe object is a derived object.
Derivedobject-> getobjectref ()The derived object is derived from that object ..
With the above three functions, You can traverse a node from creation to formation of this node, all the derived objects that have passed through.
If you want to obtain the final object state (objectstate. It contains the object of node) on the node, you only need to call inode-> evalworldstate.
Below. I will introduce several tm that are easy to cause confusion in node.
Inode-> getnodetm ().:Nodetm () only contains the TM of node. it is not the TM of an object. each node has a benchmark point ). the state of this vertex in the coordinates of the world is the TM of this node. objects attached to the node may have other transformations (such as flat and rotation) relative to the vertex point ). so. nodetm cannot be used to convert objects.
Inode-> getparenttm ().The TM of the parent node. We have said that nodetm is in the coordinates of the world. Therefore, to obtain the TM of the node relative to the parent node, getnodetm () * inverse (getparenttm () is required ()).
Inode-> getobjecttm ().With this matrix, you can transform the objects in node to the world space.
ActuallyGetobjecttm () = nodetm () * (Object transformation to node ).
Inode-> getobjtmafterwsm (): WSM indicates the World Space modifer. There are two types of modifer, one of which is the object space. One is World Space. as the name implies: The World Space modifier must first transform the object to the world space. it is not in the object space. Therefore, if an object (object on node) is affected by World Space modifier. We have transformed the vertex into the world coordinate system during evalworldstate. Getobjecttm will return the transformation of the object from the inode local coordinate system to the matrix of the world coordinate system. If we multiply the objecttm vertex (after WSM, the vertex is already in the world space ), we have made two world transformations, so we need to obtain a matrix of nodes, which means that the vertices after the WSM transformation can be correctly transformed into the world space. this matrix isGetobjtmafterwsm ().If there is no WSM on an inode, getobjtmafterwsm () is the same as getobjecttm. Similarly, it is the same as getobjtmbeforewsm.
Inode-> getobjtmbeforewsm (): The objecttm that this function applies to WSM before inode. That is, when this inode does not include WSM, It will transform the vertex of its object to the transformation matrix in the world coordinate system ..
The above is my example. See the following in the max SDK:
The node and object offset Transformations
Geometry Pipeline System
.
Posted here, hoping to make things in the max SDK attract your attention.
There are a lot of things in the max SDK that are not rational.
Xheartblue 2005-1-6 early morning