|
camera实现一个小窗口,不设置投影矩阵式正确的。设置了投影矩阵小窗口中就没有内容。本来以为是远近裁剪面问题,但尝试多次还是没有看内容。
camera->setViewMatrixAsLookAt(osg::Vec3(0.644,0.644,0.355),osg::Vec3(0.644,0.644,20.955),osg::Vec3(0.0f,1.0f,0.0f));
camera->setViewport(10,10,300,200);////
camera->setCullingActive(true);
camera->setReferenceFrame(osg::Transform::RELATIVE_RF);// 随主窗口变化
camera->setTransformOrder(osg::CameraNode:OST_MULTIPLY);
camera->setClearMask(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
camera->setRenderOrder(osg::CameraNode::POST_RENDER);
//////////////////////////////////////////////////////////////////
//camera->setProjectionMatrixAsPerspective (48.0,1.33, 1.0,1000);//这句话加上就会使得小窗口没有场景出现 |
|