OSG贴图不对

asdqwe123bbb 发布于 02/14 15:55
阅读 13
收藏 0

使用OSG做纹理贴图,效果与实际模型不一致:

                    osg::ref_ptr<osg::Texture2D> texture = new osg::Texture2D;
                    osg::ref_ptr<osg::Image> image = osgDB::readImageFile(TextureFilePath);
                    texture->setImage(image.get());
                    texture->setDataVariance(osg::Object::DYNAMIC);
                    texture->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR_MIPMAP_LINEAR);
                    texture->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR);
                    texture->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT);
                    texture->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT);
                    OsgMesh->getOrCreateStateSet()->setTextureAttributeAndModes(0, texture.get(),                     osg::StateAttribute::ON);

效果图:

实际:  

贴图:

加载中
返回顶部
顶部

页面底部区域 foot.htm