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

  • 相关阅读:
    c文件操作库
    双链常用操作2
    双向链表常用操作
    c队列操作
    c日期格式化操作之date
    单链常用操作类
    c字符串常用操作
    双向链表通用类
    c栈操作
    poj2509
  • 原文地址:https://www.cnblogs.com/tekkaman/p/7701596.html
Copyright © 2011-2022 走看看