helpers.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:BlenderRobotDesigner 作者: HBPNeurorobotics 项目源码 文件源码
def _mat3_to_vec_roll(mat):
    """
    Function to convert a 3x3 rotation matrix to a rotation axis and a roll angle along this axis
    Python port of the C function defined in armature.c

    Thanks to blenderartists.org user vida_vida

    :param mat:
    :return:
    """
    from ..properties.globals import global_properties
    vec = mat.col[1] * global_properties.bone_length.get(bpy.context.scene)
    vecmat = _vec_roll_to_mat3(mat.col[1], 0)
    vecmatinv = vecmat.inverted()
    rollmat = vecmatinv * mat
    roll = math.atan2(rollmat[0][2], rollmat[2][2])
    return vec, roll
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号