|
发表于 2008-9-26 21:52:19
|
显示全部楼层
原帖由 hljzh 于 2008-9-26 21:34 发表 ![](http://bbs.osgchina.org/images/common/back.gif)
我上边的代码逻辑对吗 版主
没什么问题,我想这样就可以:
for ( int i=0; i<maxSize; ++i )
{
osg::Vec4Array* colors = new osg::Vec4Array;
Geometry *geometry = geode->getDrawable(i);
colors->push_back(osg::Vec4(xxx, xxx, xxx, 1.0f) );
geometry->setColorArray(colors);
geometry->setColorBinding(osg::Geometry::BIND_OVERALL);
}
注意每次都要定义新的colors数组才行,绝不能用同一个的!
[ 本帖最后由 array 于 2008-9-26 21:54 编辑 ] |
|