如何从 .IV 文件为渲染的几何体应用状态集
How to apply stateset for a rendered geometry from an .IV file
我想将状态集应用于 .iv 文件中渲染的几何体。例如。。
// this will render the geometry;
osg::ref_ptr<osg::Group> root = dynamic_cast <osg::Group*>(osgDB::ReadNodeFile("cow.osg"));
// want to apply stateset for above rendered file from .iv file
`osg::ref_ptr<osg::Stateset> state = dynamic_cast <osg::Stateset*>(osgDB::ReadNodeFile("gold.osg"));`
.IV文件仅包含材料属性 ( ambient,specular,shininess.......
)它没有任何要渲染的几何图形。
gold.osg 包含如下代码:-
stateset{
name c:/Documents And Settings/Gthm/Desktop/gold.osg
DataVariance 1
rendering_hint DEFAULT_BIN
renderingBinMode INHERIT
binNumber 0
binName
Material{
ambientColor 0.5 0.6 0.8
diffuseColor 0.5 0.6 0.8
specularColor 0.5 0.6 0.8
emissiveColor 0 0 0
shininess 128
transparency 0
}
}
如果您的第二个文件只有一个包含所需状态集的节点,您可以执行以下操作:
root->setStateSet(osgDB::ReadNodeFile("gold.osg")->getOrCreateStateSet());
相关文章:
- 无法将结构注册为增强几何体3D点
- 试图在visual studio上用C++创建一个桌面应用程序
- FFmpeg:制作一个应用程序比直接使用ffmepg更好吗
- c++r值引用应用于函数指针
- 在C应用程序中运行C++(带有STL)函数
- 使用VerQueryValue检索应用程序的文件描述
- Qt C++静态thread_local QNetworkAccessManager是线程应用程序的好选择吗
- 使用调试/崩溃报告将应用程序部署到客户端
- C++控制台应用程序阻止退出
- 码头化的C++应用程序是否向后兼容早期的内核版本
- 将应用程序从32位移植到64位时出现问题
- 有没有任务栏API可以立即应用注册表更改
- 如何改变c++应用程序的视觉效果
- WM_CTLCOLORSTATIC从未在WIN32应用程序中触发
- PC中的程序和PHONE中的本机描述应用程序之间的数据连接
- 应用程序崩溃并显示"symbol _ZdlPvm, version Qt_5 not defined in file libQt5Core.so.5 with link time reference"
- 示例外壳应用程序显示的 V8 "segmentation fault (core dumped)"错误
- phytec phyBOARD iMX-6在从闪存而不是SD卡运行qt5 opengles应用程序时表现不佳(FPS减半
- 如何从 .IV 文件为渲染的几何体应用状态集
- 如何使用Windows应用商店C++在没有窗口句柄的情况下渲染路径几何体