//定义颜色数组
osg::ref_ptr<osg::Vec4Array> c = new osg::Vec4Array;
_geom->setColorArray(c.get());
_geom->setColorBinding(osg::Geometry::BIND_OVERALL);
c->push_back(_LineColor);
//定义法线
osg::ref_ptr<osg::Vec3Array> n = new osg::Vec3Array;
_geom->setNormalArray(n.get());
_geom->setNormalBinding(osg::Geometry::BIND_OVERALL);
n->push_back(osg::Vec3(0.f, -1.f, 0.f));
_pointArray = new osg::Vec3Array;
_geom->setVertexArray(_pointArray.get());
}
//添加顶点
....
_geom->addPrimitiveSet(
new osg::DrawArrays(osg:rimitiveSet:UADS, primitiveSetCount, 4));
primitiveSetCount++;