zoukankan      html  css  js  c++  java
  • 有关四元数 我所理解的四元数

    世界空间,朝世界原点的朝向移动d ,换到mPosition的所在父空间只需要旋转一定角度,

    这个角度应该是世界原点方向和父节点的方向的夹角,正好是父节点世界绝对角度再取反.

    (为什么要取反,2个四元数相乘是不能交换的,因为世界节点和父节点夹角 != 父节点和世界节点夹角,正好相反)

           mPosition += (mParent->_getDerivedOrientation().Inverse() * d)
                        / mParent->_getDerivedScale();


    根据这段话 我想 由A 到B的用了 四元数 Orientation 由B到A的话就应该是 Orientation.Inverse()

    我知道 quaternion*quaternion是不满足交换律的

    vector3*quaternion我明白

    我不知道。。。也许是      quaternion*vector3的意思是

    A. Multiplying a quaternion by a vector gives us a vector describing the rotational offset from that vector (a rotated vector). For example when one loads the robot.mesh file, by default it points facing UNIT_X. When it has been rotated, we can get its orientation in quaternion form via mNode->getOrientation(). If we then multiply it by Vector3::UNIT_X, we will get a vector pointing in the direction the robot is currently facing.

    在看这句话这句话意思很明显 Orientation 是一个旋转量 Orientation *v3得到的是 v3按Orientation 旋转后的向量

    有一点 。。。这里讨论的四元数 是ogre的一个类 他有一个operator *参数是vector3表示的意义是 v3按此quaternion旋转后的结果 that's it

    而 vector3*quaternion根本就没定义。。。差不多明白了

     Vector3 Quaternion::operator* (const Vector3& v) const

        {

    // nVidia SDK implementation

    Vector3 uv, uuv;

    Vector3 qvec(x, y, z);

    uv = qvec.crossProduct(v);

    uuv = qvec.crossProduct(uv);

    uv *= (2.0f * w);uuv *= 2.0f;
    return v + uv + uuv;
        }

    实在不想推到 不过只用到了 外积 和向量 应该还是可解的

    没有任何矛盾的地方目前

    quaternion *quaternion 表示将这些旋转叠加

    vector3*quaternion 无定义

    quaternion*vector3表示 vector按q旋转

    明天在程序里测下

  • 相关阅读:
    软件需求阅读笔记二
    寒假小程序开发记录2
    软件需求阅读笔记一
    寒假小程序开发记录1
    软件工程概论课个人总结
    06大道至简阅读笔记
    golang算法——leetcode-46
    实验 5 Spark SQL 编程初级实践
    scala链接数据库Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    Error:(15, 103) value toDF is not a member of org.apache.spark.rdd.RDD[Employee] .map(attributes => Employee(attributes(0).trim.toInt, attributes(1), attributes(2).trim.toInt)).toDF()
  • 原文地址:https://www.cnblogs.com/minggoddess/p/1907374.html
Copyright © 2011-2022 走看看