|
用以下语句实现的节点的旋转:
const osg::BoundingSphere& bs = node->getBound();
float size = 1.0f;
osg::MatrixTransform* positioned = new osg::MatrixTransform;
positioned->setDataVariance(osg::Object::STATIC);
positioned->setMatrix( osg::Matrix::translate(-bs.center())
osg::Matrix::scale(size,size,size)*
osg::Matrix::rotate(osg::inDegrees(-60.0f),0.0f,1.0f,0.0f));
positioned->addChild( node);
osg:ositionAttitudeTransform* xform = new osg::PositionAttitudeTransform;
xform->addChild(positioned);
root->addChild(xform);
发现节点错位了,应该如何实现?
纯粹新手,问题可能很幼稚 |
|