zoukankan      html  css  js  c++  java
  • blender坐标系梳理

    blender坐标系梳理

    一、 目的

    理解Blender三维建模软件建模坐标系,obj输出方式,以及与OpenGL坐标系的关系。

    二、Blender坐标系解析

    0. 建模坐标系

    在Blender中, 建模坐标系如下图((R,F,U))(向右,向前,向上)所示:
    blender坐标意图

    在建模坐标系中, 各轴用列向量方式表示为:

    [R=e_1=egin{pmatrix}1\0\0end{pmatrix}, F=e_2=egin{pmatrix}0\1\0end{pmatrix}, U=e_3=egin{pmatrix}0\0\1end{pmatrix} ]

    1. Blender中obj输出坐标说明

    1.0 基本定义

    设点在建模坐标系((R,F,U))下的坐标为(egin{pmatrix}x_o\y_o\z_oend{pmatrix}),在输出坐标系((X,Y,Z))下的坐标为(egin{pmatrix}x\y\zend{pmatrix}),输出坐标系到建模坐标系的转换矩阵为(M),则有

    [egin{pmatrix}x_o\y_o\z_oend{pmatrix}=Megin{pmatrix}x\y\zend{pmatrix} ]

    [egin{pmatrix}x\y\zend{pmatrix}=M^{-1}egin{pmatrix}x_o\y_o\z_oend{pmatrix} ]

    1.1 (向上:Z,向前:Y)输出

    blender坐标意图

    此输出方式下,输出坐标系即为建模坐标系,

    [X=R=e_1, Y=F=e_2, Z=U=e_3 ]

    建模坐标(egin{pmatrix}x_o\y_o\z_oend{pmatrix})与输出坐标(egin{pmatrix}x\y\zend{pmatrix})的转换关系为

    [egin{pmatrix}x_o\y_o\z_oend{pmatrix}=xe_1 + ye_2 + ze_3 = (e_1,e_2,e_3)egin{pmatrix}x\y\zend{pmatrix}=egin{pmatrix}x\y\zend{pmatrix} ]

    [egin{pmatrix}x_o\y_o\z_oend{pmatrix}=egin{pmatrix}x\y\zend{pmatrix} ]

    转换矩阵及其逆矩阵为

    [M = (e_1,e_2,e_3)=egin{pmatrix}1 & 0 & 0\0 & 1 & 0\0 & 0 &1end{pmatrix}= E_3 ]

    [M^{-1} = M^T = M = E_3 ]

    1.2 (向上: Z,向前: -Y)输出

    blender坐标意图

    此输出方式中, 输出坐标系轴在建模坐标系中为:

    [X=-R=-e_1, Y=-F=-e_2, Z=U=e_3 ]

    建模坐标(egin{pmatrix}x_o\y_o\z_oend{pmatrix})与输出坐标(egin{pmatrix}x\y\zend{pmatrix})的转换关系为

    [egin{pmatrix}x_o\y_o\z_oend{pmatrix}=x(-e_1) + y(-e_2) + ze_3 =(-e_1,-e_2,e_3)egin{pmatrix}x\y\zend{pmatrix} ]

    转换矩阵及其逆矩阵为

    [M = (-e_1,-e_2,e_3)=egin{pmatrix}-1 & 0 & 0\0 & -1 & 0\0 & 0 &1end{pmatrix} ]

    [M^{-1} = M^T = M ]

    1.3 (向上: Y,向前: -Z)输出(OpenGL坐标系)

    blender坐标意图

    此输出方式中,输出坐标系与建模坐标系的关系为:

    [X=R=e_1, Y=U=e_3, Z=-F=-e_2 ]

    建模坐标(egin{pmatrix}x_o\y_o\z_oend{pmatrix})与输出坐标(egin{pmatrix}x\y\zend{pmatrix})的转换关系为

    [egin{pmatrix}x_o\y_o\z_oend{pmatrix}=x(e_1) + y(e_3) + z(-e_2) =(e_1,e_3,-e_2)egin{pmatrix}x\y\zend{pmatrix} ]

    转换矩阵及其逆矩阵为

    [M = (e_1,e_3,-e_2)=egin{pmatrix}1 & 0 & 0\0 & 0 & -1\0 & 1 &0end{pmatrix} ]

    [M^{-1} = M^T = egin{pmatrix}1 & 0 & 0\0 & 0 & 1\0 & -1 &0end{pmatrix} ]

    1.4 (向上: Y,向前: Z)

    blender坐标意图

    此输出方式中,输出坐标系与建模坐标系的关系为:

    [X=-R=-e_1, Y=U=e_3, Z=F=e_2 ]

    建模坐标(egin{pmatrix}x_o\y_o\z_oend{pmatrix})与输出坐标(egin{pmatrix}x\y\zend{pmatrix})的转换关系为

    [egin{pmatrix}x_o\y_o\z_oend{pmatrix}=x(-e_1) + y(e_3) + z(e_2) =(-e_1,e_3,e_2)egin{pmatrix}x\y\zend{pmatrix} ]

    转换矩阵及其逆矩阵为

    [M = (-e_1,e_3,e_2)=egin{pmatrix}-1 & 0 & 0\0 & 0 & 1\0 & 1 &0end{pmatrix} ]

    [M^{-1} = M^T = M = egin{pmatrix}-1 & 0 & 0\0 & 0 & 1\0 & 1 &0end{pmatrix} ]

  • 相关阅读:
    【故障处理】ORA-12162: TNS:net service name is incorrectly specified (转)
    android studio 编程中用到的快捷键
    java时间格式串
    android Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine.
    linux安装vmware
    x1c 2017 安装mint18的坑——grub2
    x1c2017 8G版 win linux的取舍纠结记录
    python的try finally (还真不简单)
    kafka+docker+python
    json文件不能有注释
  • 原文地址:https://www.cnblogs.com/yaoyu126/p/12619106.html
Copyright © 2011-2022 走看看