|
楼主 |
发表于 2010-12-30 10:49:58
|
显示全部楼层
我把图发上来
图中那些拉高的地方就再也选不中了
生成地面代码:
for (unsigned int i=0;i<GRIDWIDTH;i+=10)
{
for (unsigned int j=0;j<GRIDWIDTH;j=j+10)
{
coords->push_back(osg::Vec3(i,j,0));
texCoord->push_back(osg::Vec2(i/GRIDWIDTH,j/GRIDWIDTH));
}
}
osg::ref_ptr<osgUtil:elaunayTriangulator> dt
=new osgUtil::DelaunayTriangulator(coords.get());
dt->triangulate();
osg::StateSet* stateSet=new osg::StateSet();
osg::ref_ptr<osg::Geometry> geometry=new osg::Geometry();
geometry->setVertexArray(coords.get());
geometry->addPrimitiveSet(dt->getTriangles());
geometry->setUseDisplayList(false);
//geometry->setUseVertexBufferObjects(true);
geometry->setTexCoordArray(0,texCoord.get());
…… |
|