|
楼主 |
发表于 2011-3-21 17:03:05
|
显示全部楼层
本帖最后由 zhoujiajun2010 于 2011-3-21 17:13 编辑
请问锐哥,我通过设置材质的Alpha值,怎么实现不了啊,
osg::ref_ptr<osg::Node> node=osgDB::readNodeFile("cessna.osg");
osg::ref_ptr<osg::StateSet>state=new osg::StateSet();
state=node->getOrCreateStateSet();
osg::ref_ptr<osg::Material> material=new osg::Material();
material->setAlpha(osg::Material::FRONT_AND_BACK,0.5);
state->setAttributeAndModes( material, osg::StateAttribute::ON );
material->setEmission( osg::Material::FRONT_AND_BACK, osg::Vec4( 1.0f, 1.0f, 1.0f, 0.1f ) );
您看一下是不是那地方出错了啊,谢谢!!! |
|