|
楼主 |
发表于 2011-3-28 20:36:02
|
显示全部楼层
回复 2# array
感谢array,我试一下关闭光照。
另外还想请问一下怎么样正确地设置屏幕矩形的观察矩阵呢?
例如,目前我是这样实现的:
//屏幕矩形
_quad->addDrawable(osg::createTexturedQuadGeometry(osg::Vec3(0.5,0.0,0.5),osg::Vec3(1.0,0.0,0.0),osg::Vec3(0.0,0.0,1.0)));
//FBO相机参数设置
_cam=new osg::Camera;
_cam->setClearMask(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
_cam->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
_cam->setViewport(0,0,128,128);
_cam->setRenderOrder(osg::Camera:RE_RENDER);
_cam->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
_cam->setProjectionMatrixAsOrtho2D(0.0,1.0,0.0,1.0);
_cam->setViewMatrixAsLookAt(osg::Vec3(0.5,-1.0,0.5),osg::Vec3(0.5,0.0,0.5),osg::Vec3(0.0,0.0,1.0));
不知设置的是否有问题呢?请指教,谢谢! |
|