|
各位大神,我用geode绘制了一个球体,但是当把它的透明度增加后,出现了这种现象(见附件)
这是有关的代码,不多:
osg::ref_ptr<osg::Geode> geode1 = new osg::Geode;
osg::ShapeDrawable *shapeBall=new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0,0,0), 2));
osg::ref_ptr<osg::Material> material = new osg::Material();
material->setTransparency(osg::Material::FRONT_AND_BACK,0.5);
material->setEmission(osg::Material::FRONT_AND_BACK, osg::Vec4(1.0,0.0,0.0,1.0));
geode1->getOrCreateStateSet()->setAttributeAndModes(material,osg::StateAttribute::ON);
geode1->getOrCreateStateSet()->setMode(GL_BLEND,osg::StateAttribute::ON);
geode1->addDrawable(shapeBall);
我想知道怎么能把那个不是红色的区域去掉,那些还需要设置?
希望大神给予解答,谢谢!! |
|