zoukankan      html  css  js  c++  java
  • 绑定姿势

    绑定姿势

      //The Bind Pose Matrices allow a raw vertex of the mesh (in local coordinates) to be transformed into world-space
      // and then to each bone's local coordinate space, after which each bone's animation can be applied to the vertex in question
      // (under the influence of the weighting value). The mesh's bind pose takes the vertex from local space to world-space,
      // and then each bone's inverse bind pose takes the mesh vertex from world-space to the local space of that bone.

      // The mesh's Bind Pose Matrix takes its vertices into world-space, to the location at the time of binding,
      // and each bones' Bind Pose Matrix takes the bones from local space to world-space at the time of binding.

      bind pose是指将vertex从local coord转换到world coord的matrix。而inverse bind pose起相反world 2 local的作用。

      在Unity中,上述的mesh bind pose与bone inverse bind pose,合2为一,为mesh.bindposes属性。

      

      Unity官方示例中,有一段计算 bindPose的代码,

            Transform[] bones = new Transform[2];
            Matrix4x4[] bindPoses = new Matrix4x4[2];
            bones[0] = new GameObject("Lower").transform;
            bones[0].parent = transform;
            // Set the position relative to the parent
            bones[0].localRotation = Quaternion.identity;
            bones[0].localPosition = Vector3.zero;
            // The bind pose is bone's inverse transformation matrix
            // In this case the matrix we also make this matrix relative to the root
            // So that we can move the root game object around freely
            bindPoses[0] = bones[0].worldToLocalMatrix * transform.localToWorldMatrix;
    View Code

      

    参考:http://blog.csdn.net/watersevenmmfx/article/details/51920439

  • 相关阅读:
    MyEclipse取消自动跳到Console窗口
    JAVA Socket超时浅析
    利用WireShark进行DNS协议分析
    SSL/TLS协议工作流程
    Linux下安装MySQL
    使用Java中的动态代理实现数据库连接池
    在Linux下安装和使用MySQL
    自省 另外一种python 生成随机在base36 之间的兑换码生成。
    python 时间转换相关
    关于utf8mb4的学习了解笔记
  • 原文地址:https://www.cnblogs.com/tekkaman/p/7701596.html
Copyright © 2011-2022 走看看