|
测试了下,- osg::ref_ptr<osg::ShapeDrawable> RegularHexahedron1 = new osg::ShapeDrawable;
- RegularHexahedron1->setShape( new osg::Box(osg::Vec3(50.0f, 0.0f, -200.0f), 50.0f, 50.0f, 50.0f) );
- osg::ref_ptr<osg::ShapeDrawable> RegularHexahedron2 = new osg::ShapeDrawable;
- RegularHexahedron2->setShape( new osg::Box(osg::Vec3(-50.0f, 0.0f, -200.0f), 50.0f, 50.0f, 50.0f) );
复制代码- view->getCamera()->setViewMatrixAsLookAt(
- osg::Vec3(0.0f,0.0f,0.0f), osg::Vec3(0,0,-100), osg::Y_AXIS );
-
- osgViewer::CompositeViewer viewer;
- viewer.addView( view );
- while ( !viewer.done() )
- {
- viewer.frame();
- }
复制代码 发现还是不能完整显示两个方块儿,两个方块共宽150,视距 200,tanV/2 = 75/200 这样估算视角不到60度
osg的视角是变化的还是固定大小? OpenGL呢? |
|