|
mRoot是我场景的根节点
前视图:
osg::Vec3 center = mRoot->asGroup()->getBound().center();
mViewer->addSlave(camera.get(),osg::Matrix(),osg::Matrix::translate(osg::Vec3(center.x(),center.y(),center.z()))*osg::Matrix::rotate(osg:egreesToRadians(0.0),0,1,0));
后视图:
osg::Vec3 center = mRoot->asGroup()->getBound().center();
mViewer->addSlave(camera.get(),osg::Matrix(),osg::Matrix::translate(osg::Vec3(center.x(),center.y(),center.z()))*osg::Matrix::rotate(osg::DegreesToRadians(180.0),0,1,0));
左视图:
osg::Vec3 center = mRoot->asGroup()->getBound().center();
mViewer->addSlave(camera.get(),osg::Matrix(),osg::Matrix::translate(osg::Vec3(center.x(),center.y(),center.z()))*osg::Matrix::rotate(osg::DegreesToRadians(90.0),0,1,0));
右视图:
osg::Vec3 center = mRoot->asGroup()->getBound().center();
mViewer->addSlave(camera.get(),osg::Matrix(),osg::Matrix::translate(osg::Vec3(center.x(),center.y(),center.z()))*osg::Matrix::rotate(osg::DegreesToRadians(270.0),0,1,0));
这个slave参数矩阵到底该怎么计算啊?谢啦大家 给说下啦 |
|