|
我的obj模型都是四边形面片,现在用osgdb::readnodefile载入后,想用线框模式显示,结果发现画出来的是三角网格,怎样才能以四边形网格显示呢??下面是线框模式的代码,其中ws.quad_mesh就是载入obj模型后的osg::Node
- osg::StateSet* stateset = ws.quad_mesh.get()->getOrCreateStateSet();
- osg::ref_ptr<osg::PolygonMode> polygonMode = new osg::PolygonMode();
- polygonMode->setMode( osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::LINE);
- stateset->setAttribute( polygonMode.get(), osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON );
复制代码 |
|