【正文】
, )。 // 創(chuàng)建一個四元數(shù),實現(xiàn)圍繞 axis 旋轉(zhuǎn) theta 弧度。 void setAttitude()。 osg::PositoinAttitude in the development practice, osg::MatrixTransform is not easy to use. So we have osg::PositionAttitude. this class provides several public member funcitons: void setPosition()。 const Quatamp。 //設(shè)置和獲取旋轉(zhuǎn)的四元數(shù) void setAttitude(const Quatamp。 const Vec3amp。 //設(shè)置和獲取平移的距離 void setPosition(const Vec3amp。 osg::Matrix getMatrix()。 osg::Matrix resultMat=mat1*mat2。 osg::Matrix Modelview transformations can be done with osg::Matrix, so osg::Matrix is a very kind of important data type. osg::Matrix is 4*4. ? makeTranslate(),makeRotate(),makeScale() reset the current matrix and create a 4*4 translation, rotation, and scale matrix. ? Static method can create a new matrix:translate(), rotate(),scale(). osg::Matrix osg::Matrix mat1=osg::Matrix::scale(sx,sy,sz)。 //獲取空間變換矩陣 const Matrixamp。 //設(shè)置節(jié)點的參考坐標(biāo)系 void setReferenceFrame(ReferenceFrame rf) osg::MatrixTransform類 :直接設(shè)置空間變換矩陣 //設(shè)置空間變換矩陣 void setMatrix(con