osg的矩阵表达形式为osg::Matrix
ObjectArx的矩阵表达式为AcGeMatrix3d
occt的矩阵表达式分gp_Trsf及支持变形的gp_GTrsf
osg矩阵转化为ObjectArx
osg::Matrix mVPW; TcGeMatrix3d matrix; for (int i = 0; i < 4; ++i) { for (int j = 0; j < 4; ++j) { matrix(j, i) = mVPW(i, j); } } 注意行列是要反一下的
osg矩阵转换为gp_Trsf,必须是等比矩阵可用
gp_Trsf aTrsf; aTrsf.SetValues(mVPW(0, 0), mVPW(1, 0), mVPW(2, 0), mVPW(3, 0), mVPW(0, 1), mVPW(1, 1), mVPW(2, 1), mVPW(3, 1), mVPW(0, 2), mVPW(1, 2), mVPW(2, 2), mVPW(3, 2));
osg矩阵转换为gp_GTrsf
gp_GTrsf aGTrsf; for (int i = 0; i < 3; ++i) { for (int j = 0; j < 4; ++j) { aGTrsf.SetValue(i + 1, j + 1, mVPW(j, i)); } } 注意行列是反的
标签:gp,int,occt,矩阵,++,objectarx,mVPW,osg From: https://www.cnblogs.com/unicornsir/p/18358754