|
楼主 |
发表于 2010-11-25 21:05:17
|
显示全部楼层
...............
osg::ref_ptr<osg::StateSet>createTexture2DState(osg::ref_ptr<osg::Image>image)
{
osg::ref_ptr<osg::StateSet>stateset=new osg::StateSet();
osg::ref_ptr<osg::Texture2D>texture=new osg::Texture2D();//创建二维纹理对象
texture->setDataVariance(osg::Object:YNAMIC);
texture->setImage(image.get());//设置贴图
stateset->setTextureAttributeAndModes(0,texture.get(),osg::StateAttribute::ON);
return stateset.get();
}
.............
.............
创建二维纹理对象,并在主函数中使用二维纹理,可是运行的结果中没有显示纹理效果?? |
|