杨文庆 发表于 2017-1-11 10:25:49

谁能解释一下是什么意思?

本帖最后由 杨文庆 于 2017-1-11 10:29 编辑

void TrackballManipulator::computePosition(const osg::Vec3& eye,const osg::Vec3& center,const osg::Vec3& up)

{    osg::Vec3 lv(center-eye);



    osg::Vec3 f(lv);

    f.normalize();

    osg::Vec3 s(f^up);

    s.normalize();

    osg::Vec3 u(s^f);

    u.normalize();

   

    osg::Matrix rotation_matrix(s,   u,   -f,   0.0f,

                              s,   u,   -f,   0.0f,

                              s,   u,   -f,   0.0f,

                              0.0f,   0.0f,   0.0f,      1.0f);

   //矩阵rotation_matrix相当于把“倾斜”的uvn坐标系变为“正”的opengl标准坐标系,下面的_rotation是rotation_matrix的逆矩阵,相当于把“正”的opengl标准坐标系变为“倾斜”的uvn坐标系

    _center = center;

    _distance = lv.length();

    _rotation = rotation_matrix.getRotate().inverse();

}

lv是什么意思?
f(lv),s(f^up)又是什么意思?

jevonsea 发表于 2017-2-3 08:43:04

lv是从视点到观察点的向量

风云轩 发表于 2017-2-4 15:56:17

自己去补数学知识
页: [1]
查看完整版本: 谁能解释一下是什么意思?