|
楼主 |
发表于 2009-11-4 17:15:44
|
显示全部楼层
本帖最后由 boystu 于 2009-11-4 17:19 编辑
8# array
osg::Geometry *geom = new osg::Geometry();
osg::ref_ptr<osg::Vec3Array> v = new osg::Vec3Array();
v->push_back(osg::Vec3(first[0] , first[1] , first[2]));
v->push_back(osg::Vec3(second[0], second[1] , second[2]));
v->push_back(osg::Vec3(third[0] , third[1] , third[2]));
v->push_back(osg::Vec3(fourth[0], fourth[1] , fourth[2]));
geom->setVertexArray(v);
geom->addPrimitiveSet(new osg:rawArrays(osg:rimitiveSet:UADS,0,4));
osgUtil::SmoothingVisitor::smooth(*geom);
osg::ref_ptr<osg::Vec4Array> vc = new osg::Vec4Array();
vc->push_back(osg::Vec4(r[0],g[0],b[0],1.0f));
vc->push_back(osg::Vec4(r[1],g[1],b[1],1.0f));
vc->push_back(osg::Vec4(r[2],g[2],b[2],1.0f));
vc->push_back(osg::Vec4(r[3],g[3],b[3],1.0f));
geom->setColorArray(vc);
geom->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
return geom;
上面的代码是creatquad函数的代码!看看有什么问题 |
|