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);

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章