|
楼主 |
发表于 2013-4-16 23:00:18
|
显示全部楼层
class RotateCB:public osg::NodeCallback
{
public:
RotateCB(){}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
osg::MatrixTransform* mtLeft = dynamic_cast<osg::MatrixTransform*>(node);
osg::Matrix mR, mT;
mT.makeTranslate(-2., 0., 0.);
mR.makeRotate(angle, osg::Vec3(0., 0., 1.));
mtLeft->setMatrix(mR * mT);
traverse(node, nv);
}
}; |
|