osg中设置线宽和点的大小

#include <osg/LineWidth>
#include <osg/Point>



osg::ref_ptr<osg::StateSet> stateset = lineGeode->getOrCreateStateSet();
osg::ref_ptr<osg::LineWidth> lineWid = new osg::LineWidth(10.0f);

stateset->setAttribute(lineWid);


//注意设置点的大小前提是几何图元必须是osg::PrimitiveSet::POINTS
	osg::StateSet* stateSet = root->getOrCreateStateSet();
	osg::Point* pointSize = new osg::Point;
	pointSize->setSize(4.0);
	stateSet->setAttribute(pointSize);

猜你喜欢

转载自blog.csdn.net/a_Treasure/article/details/83022365
今日推荐