osg::MatrixTransform和osg::Matrix

 

  1.   给MatrixTransform设置矩阵的方法
osg::MatrixTransform *  rootnode  =   new  osg::MatrixTransform;
rootnode
-> setMatrix(osg::Matrix::rotate(osg::inDegrees( 30.0f ), 1.0f , 0.0f , 0.0f ));

对于上述代码,osg::Matrix::rotate实际上相当于:

 

inline Matrixd Matrixd::rotate(value_type angle,  const  Vec3f &  axis )
 
{
     Matrixd m;
     m.makeRotate(angle,axis);
     
return m;
}

 

你可能感兴趣的:(osg::MatrixTransform和osg::Matrix)