|
发表于 2014-5-13 22:04:57
|
显示全部楼层
// 一个球心在原点,半径为10的球
osg::ref_ptr< osg::sphere > sphere =
new osg::sphere( osg::Vec3( 0.0f, 0.0f, 0.0f ), 10 );
// 创建精细度对象
osg::ref_ptr< osg::TessellationHints > hints =
new osg::TessellationHints ();
hints->setDetailRatio( 0.5 );
// osg::ref_ptr< osg::ShapeDrawable > earth =
new osg::ShapeDrawable( sphere, hints.get() );
// 将此球颜色设为红色
earth->setColor( osg::Vec4( 1.0f, 0.0f, 0.0f, 1.0f );
NOTE:osg::ShapeDrawable 里面才有设置颜色的方法 |
|