zoukankan      html  css  js  c++  java
  • osg osgDB::Options noTexturesInIVEFile ForceReadingImage dds_flip

    osgDB::writeNodeFile(node, path, new osgDB::Options("noTexturesInIVEFile"));

    noTexturesInIVEFile:选项可以在写ive模型文件的时候只写纹理文件对应的路径,而不是默认的将纹理数据写入ive文件

    更多参数,可以查看ReaderWriterIVE.cpp文件中的定义

    osg::Node* osgbNode=osgDB::readNodeFile(osgbModelFile, new osgDB::Options("ForceReadingImage"));

    ForceReadingImage:选项只对osg2,osgb,osgt,osgx起作用,它可以在纹理文件不存在(或者读取失败)时,生成一张空的纹理对象osg::Image,并记录下纹理文件对应的路径

    osg::Node* ddsImageNode=osgDB::readNodeFile(modelFile, new osgDB::Options("dds_flip"));

    在读取模型中含有dds格式纹理的时候,需要用到这个选项。如果在命令行中使用osgviewer aaa.osg -O dds_flip

    OSG自支持格式的升级版是在2010年提出的,它的目的是方便扩展、跨格式可持续更新且支持任何OSG已有的格式。比如它可以代表图片,可以代表heighfield,可以代表模型等等。

    这个升级版的插件代码在此处: src/osgPlugins/osg/ReaderWriterOSG2.cpp and wrappers at src/osgWrappers/serializers.

    它支持两种格式:

    • .osgb二进制格式
    • .osgt Ascii格式

    支持的操作为:

    • WriteImageHint=<hint> (Export option) Hint of writing image to stream.
    • <IncludeData> writes Image::data() directly;
    • <IncludeFile> writes the image file itself to stream;
    • <UseExternal> writes only the filename;
    • <WriteOut> writes Image::data() to disk as external file.
    • # ./osgconv cow.osg cow.osgb -O WriteImageHint=IncludeData
      # ./osgviewer cow.osgb
    • osgDB::writeNodeFile(node, path, new osgDB::Options("WriteImageHint=WriteOut"));
  • 相关阅读:
    ibatis resultMap 结果集映射
    iabtis初探
    struts2获取请求参数的三种方式及传递给JSP参数的方式
    Struts2的运行机制简介
    Spring AOP面向切面编程的实现
    java 单例模式及getInstance的好处
    It is indirectly referenced from required .class files
    AngularJS学习篇(二)
    AngularJS学习篇(一)
    Flex布局语法
  • 原文地址:https://www.cnblogs.com/coolbear/p/4354150.html
Copyright © 2011-2022 走看看