io_export_ogreDotScene.py 文件源码

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

项目:spqrel_tools 作者: LCAS 项目源码 文件源码
def swap(vec):
    if CONFIG['SWAP_AXIS'] == 'xyz': return vec
    elif CONFIG['SWAP_AXIS'] == 'xzy':
        if len(vec) == 3: return mathutils.Vector( [vec.x, vec.z, vec.y] )
        elif len(vec) == 4: return mathutils.Quaternion( [ vec.w, vec.x, vec.z, vec.y] )
    elif CONFIG['SWAP_AXIS'] == '-xzy':
        if len(vec) == 3: return mathutils.Vector( [-vec.x, vec.z, vec.y] )
        elif len(vec) == 4: return mathutils.Quaternion( [ vec.w, -vec.x, vec.z, vec.y] )
    elif CONFIG['SWAP_AXIS'] == 'xz-y':
        if len(vec) == 3: return mathutils.Vector( [vec.x, vec.z, -vec.y] )
        elif len(vec) == 4: return mathutils.Quaternion( [ vec.w, vec.x, vec.z, -vec.y] )
    elif CONFIG['SWAP_AXIS'] == 'aldeb':
        if len(vec) == 3: return mathutils.Vector( [vec.x, -vec.z, vec.y] )
        elif len(vec) == 4: return mathutils.Quaternion( [ vec.w, vec.x, -vec.z, vec.y] )
    else:
        print( 'unknown swap axis mode', CONFIG['SWAP_AXIS'] )
        assert 0

## Config
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号