osg::StateSet* ss=node->getOrCreateStateSet();

1、光照

ss->setMode(GL_LIGHTING, osg::StateAttribute::OFF);

2、填充模式

ss->setAttributeAndModes(new osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::LINE), osg::StateAttribute::ON);

ss->setAttributeAndModes(new osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::FILL), osg::StateAttribute::ON);

3、线宽

osg::LineWidth* lw=new osg::LineWidth();

lw->setWidth(5);

ss->setAttributeAndModes(lw, osg::StateAttribute::ON);

4、点的尺寸

osg::Point* p = new osg::Point();

p->setSize(3);

ss->setAttribute(p);

5、透明

geo->getOrCreateStateSet()->setMode(GL_BLEND, osg::StateAttribute::ON);
geo->getOrCreateStateSet()->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2021-07-17
  • 2022-12-23
  • 2021-07-08
相关资源
相似解决方案