在FBX文件中,我无法理解变换和transform -link之间的差异

发布于 2025-01-23 03:53:20 字数 341 浏览 4 评论 0原文

研究它

我对FBX非常陌生,并且在该领域并不熟悉,因为我刚刚开始在FBX SDK参考指南中

Transform refers to the global initial position of the node containing the link

TransformLink refers to global initial position of the link node

,因此说:但是我无法理解该定义。

另外,“包含链接的节点”和“链接节点”

该文档太不友好以至于无法研究FBX之间有什么区别...我可以获得一些帮助吗?

提前谢谢:)

I am very new to FBX and not familiar in this area since I just started to study it

In the FBX SDK reference guide, It says :

Transform refers to the global initial position of the node containing the link

TransformLink refers to global initial position of the link node

But I cannot understand the definition.

Also what's the difference between "node containing the link" and "link node"

The document is too unfriendly to study FBX... Can I get some help?

In advance Thanks :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

生活了然无味 2025-01-30 03:53:20

可以预期,用于动画目的的FBX网格只有一个皮肤变形物对象。将其视为网格的可变形版。

变形器包含,每个群集依次包含a 链接(或关节)。

这些对象从网格中提取如下:

VOID FbxLoader::LoadMeshBoneWeightsIndices(FbxMesh* pMesh, Mesh& mesh)
{
    // A deformer is a FBX thing, which contains some clusters
    // A cluster contains a link, which is basically a joint
    // Normally, there is only one deformer in a mesh
    // There are many types of deformers in Maya,
    // We are using only skins, so we see if this is a skin
    FbxSkin* currSkin = (FbxSkin*)(pMesh->GetDeformer(0u, FbxDeformer::eSkin));

    UINT numberOfClusters = UINT(currSkin->GetClusterCount());
    for (UINT clusterIndex = 0u; clusterIndex < numberOfClusters; ++clusterIndex)
    {
        FbxCluster* clusterPtr = currSkin->GetCluster(clusterIndex);
        UINT numOfIndices = UINT(clusterPtr->GetControlPointIndicesCount());
        DOUBLE* weightPtr = clusterPtr->GetControlPointWeights();
        INT* indicePtr = clusterPtr->GetControlPointIndices();
        std::string currJointName = clusterPtr->GetLink()->GetName();
        std::string secondName = clusterPtr->GetName();
        UINT boneIndex = BoneNameToIndex(currJointName);
        FbxAMatrix transformMatrix;
        FbxAMatrix transformLinkMatrix;
        FbxAMatrix globalBindposeInverseMatrix;

        // Now that we have the clusterPtr, let's calculate the inverse bind pose matrix.

        // The transformation of the cluster(joint) at binding time from joint space to world space
        clusterPtr->GetTransformLinkMatrix(transformLinkMatrix);
        clusterPtr->GetTransformMatrix(transformMatrix); // The transformation of the mesh at binding time
        // find out if we need geometryTransform
        globalBindposeInverseMatrix = transformLinkMatrix.Inverse() * transformMatrix; // * geometryTransform;

...

回到您的问题,代码样本还提取 transform 矩阵, transform link 矩阵:

  • 转换矩阵是本地- 网格顶点的到世界空间变换
  • transform链接矩阵是关节的局部到世界空间变换

globalBindposeInverseMatrix = transformLinkMatrix.Inverse() * transformMatrix;

对于骨骼动画的每个新框架,必须为皮肤模型中的每个骨骼生成骨偏移矩阵...而偏移矩阵是
GlobalBindPoseInversematrix 。只需将其加载到每个新动画框架中的每个骨骼的偏移矩阵成员中,例如:

LoadOffsetMatrix(globalBindposeInverseMatrix, mBoneVector[boneIndex].offset);

偏移矩阵被包装到一个阵列中,通常称为 bone Matrix Palette
正是这种骨基质调色板发送到顶点皮肤着色器,以更新每个帧的骨骼模型动画。

An FBX mesh can be expected to have only one skin deformer object for animation purposes. Think of this as a deformable version of the mesh.

The deformer contains clusters, and each cluster in turn contains a link (or joint).

These objects are extracted from the mesh as follows:

VOID FbxLoader::LoadMeshBoneWeightsIndices(FbxMesh* pMesh, Mesh& mesh)
{
    // A deformer is a FBX thing, which contains some clusters
    // A cluster contains a link, which is basically a joint
    // Normally, there is only one deformer in a mesh
    // There are many types of deformers in Maya,
    // We are using only skins, so we see if this is a skin
    FbxSkin* currSkin = (FbxSkin*)(pMesh->GetDeformer(0u, FbxDeformer::eSkin));

    UINT numberOfClusters = UINT(currSkin->GetClusterCount());
    for (UINT clusterIndex = 0u; clusterIndex < numberOfClusters; ++clusterIndex)
    {
        FbxCluster* clusterPtr = currSkin->GetCluster(clusterIndex);
        UINT numOfIndices = UINT(clusterPtr->GetControlPointIndicesCount());
        DOUBLE* weightPtr = clusterPtr->GetControlPointWeights();
        INT* indicePtr = clusterPtr->GetControlPointIndices();
        std::string currJointName = clusterPtr->GetLink()->GetName();
        std::string secondName = clusterPtr->GetName();
        UINT boneIndex = BoneNameToIndex(currJointName);
        FbxAMatrix transformMatrix;
        FbxAMatrix transformLinkMatrix;
        FbxAMatrix globalBindposeInverseMatrix;

        // Now that we have the clusterPtr, let's calculate the inverse bind pose matrix.

        // The transformation of the cluster(joint) at binding time from joint space to world space
        clusterPtr->GetTransformLinkMatrix(transformLinkMatrix);
        clusterPtr->GetTransformMatrix(transformMatrix); // The transformation of the mesh at binding time
        // find out if we need geometryTransform
        globalBindposeInverseMatrix = transformLinkMatrix.Inverse() * transformMatrix; // * geometryTransform;

...

Back to your question, the code sample also extracts the transform matrix, and the transform link matrix:

  • The transform matrix is a local-to-world space transform of the mesh vertices
  • The transform link matrix is a local-to-world space transform of the joint

Each is used to arrive at the global bind pose inverse matrix as shown.

globalBindposeInverseMatrix = transformLinkMatrix.Inverse() * transformMatrix;

For each new frame of a skeletal animation, a bone offset matrix must be generated for each bone in the skinned model... and that offset matrix is
globalBindposeInverseMatrix. Just load it into each bone's offset matrix member for every new frame of animation, for example:

LoadOffsetMatrix(globalBindposeInverseMatrix, mBoneVector[boneIndex].offset);

The offset matrices are packed together into an array, usually referred to as the bone matrix palette.
And it's this bone matrix palette which is sent to the vertex skinning shader to update the skeletal model animation each frame.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文