Max SDK's Inode transformation matrix, and some common sense of Object

xiaoxiao2021-03-06  38

In the Max SDK, INODE is a very important part. Almost all things need to be accessed by INODE: Mesh Camera et al.

Let me briefly introduce a variety of different TMs related to inode. Only represent some of the understanding of the Max SDK in the recent. I hope the expert advice. Novice discussion.

The first is to introduce Node and Object (Mesh TriObject, etc.). The Scene in Max is composed of inode, and the Node contains a lot. This Node may be deform (deformed), or not DEFORM. If a common eDITable Mesh and Cylinder are what you can deform. And Camera is not DEFORM. A geometry that contains geometric objects (that is, it can be converted to geomobject) is not Node itself. But the object in node. This object may be a derived object (indicating that this Object is derived from other objects, usually It is derived from the previous modifier (modifier). At the same time, some modifier's modification results are also a deried object. And similar PyhsiQue modifiers are role on the derived object. Therefore, To find a node, there is no Pyhsique modifier, you need to get it through DeriveD Object. Inode-> getObjectRef () can get the object's object. Object-> superclassid () == gen_derived_class_id, that is, this object is a deerid Object DeriveDObject-> getObjectRef () get this DeriveD Object is derived from that Object ..

Use the above three functions. You can traverse a Node from the created to form this Node, all passible DeriveD Object.

If you want to get the status of the final Object on this Node (ObjectState. It contains Node's object). As long as INode-> EvalWorldState () is OK.

Here. I will introduce several TM. Inode-> getnodetm () .: Nodetm () only contains Node's TM () TM (Pivot Point) with Node. This Pivot Point is in the state of the world coordinates, this is the TM of this Node. Attached to the object Point on this node may have other transformations (flat, rotation, etc.). So .nodetM can't be used to transform Object .

Inode-> getParentTM (). TM of the parent node. We said that Nodetm is in the world coordinates. So, to get the Node relative to the parent node to need getNodeTM () * inverse (getParentTM ()).

Inode-> getObjectTM (). With this matrix, you can transform Object in Node to the world space. Actually getObjectTM () = NODETM () * (Object relative to Node transformation).

Inode-> getobjtmafterwsm (): WSM means World Space Modifer. Modifer has two, one is Object Space. One is World Space. If the name is implied: World Space Modifier To convert Object to the world space. Instead of the object space, so if an Object (Object on Node) is over World Space Modifier influences. We have changed the vertices to the world coordinate system at EvalWorldState (). GetObjectTM returned to transform Object from the local coordinate system of Inode to the matrix of the world coordinate system, if the ObjectTM is multi-got, the vertex gets the top (after WSM, the vertices have been in the world space), they have done two world transformations. Therefore, we need to get a matrix of Node. This matrix is ​​to indicate the correct transformation of the VAT after the WSM transformation. This matrix is ​​getobjtmafterwsm (). If there is no WSM on one inode. So getobjtmafterwsm () It is the same as getObjectTM. Similarly, it is also the same as getobjtmbeforeWSM. Inode-> getobjtmbeforeWSM (): This function is applied to the wsm ObjectTM before inode. That is, this inode does not include the WSM, transform its Object's vertices to the transformation matrix in the world coordinate system..

The above is only my own. Refer to the Max SDK: The Node and Object Offset TransformationsGeometry Pipeline System's two parts.

Published here, I hope that things in the Max SDK can also cause everyone to pay attention. A lot of discussion. There are many things that don't have anything in Max SDK. I hope everyone can also discuss it.

XheartBlue 2005 - 1-6 early morning

转载请注明原文地址:https://www.9cbs.com/read-72624.html

New Post(0)