|
本帖最后由 superwavelet 于 2013-4-22 10:24 编辑
Hi,
osgUtil::SceneView::SceneView::ComputeStereoMatricesCallback 有四个虚函数:
virtual osg::Matrixd computeLeftEyeProjection (const osg::Matrixd &projection) const =0
virtual osg::Matrixd computeLeftEyeView (const osg::Matrixd &view) const =0
virtual osg::Matrixd computeRightEyeProjection (const osg::Matrixd &projection) const =0
virtual osg::Matrixd computeRightEyeView (const osg::Matrixd &view) const =0
刚看了一个使用ComputeStereoMatricesCallback 的例子程序:- for(unsigned int i=0; i<cameras.size(); i++)
- {
- osg::Camera *cam = cameras.at(i);
- // setup off axis projection
- OffAxisStereoCallback *callback = new OffAxisStereoCallback(this, i);
- osgViewer::Renderer *renderer = dynamic_cast<osgViewer::Renderer*>(cam->getRenderer());
- osgUtil::SceneView *sceneView1 = renderer->getSceneView(0);
- osgUtil::SceneView *sceneView2 = renderer->getSceneView(1);
- sceneView1->setComputeStereoMatricesCallback(callback);
- sceneView2->setComputeStereoMatricesCallback(callback);
- }
复制代码 我想 ComputeStereoMatricesCallback 的四个函数就应该是自动callback调用;
cameras有两个camera,每个camera要显示一个quadbuffer的3D 图形,是不是quadbuffer应该使用两个osgUtil::SceneView ?
render里面有很多歌osgUtil::SceneView 吗?
多谢啦,怎么感觉看不太懂。
|
|