|
osg::ref_ptr<osg::Node> model = osgDB::readNodeFile("d:/3ds/model.3ds");
for(int i=0; i<20000; i+=200)
{
for(int j=0; j<20000; j+=200)
{
osg::ref_ptr<osg::PositionAttitudeTransform> pat = new osg::PositionAttitudeTransform();
pat->setPosition(osg::Vec3f(i,j,0.0));
pat->addChild(model);
root->addChild(pat);
}
}
我写的上面这段代码,效率低下,才1万个,就慢的不行了,求教高效率的方法
谢谢啦 |
|