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"));
  • 相关阅读:
    【就业】腾讯VS百度
    MySQL基础知识
    PHP读取远程文件并保存
    【GTK3.0】背景设置
    【GTK】信号量(signal)大全
    c# 调用win32 api
    PHP写窗体程序
    一个苏州IT人的5年挨踢经历面试篇(之二)
    【c++ Primer 】 4.10复习题 12题(int)、(int&)和(int*)
    线段树技巧
  • 原文地址:https://www.cnblogs.com/coolbear/p/4354150.html
Copyright © 2011-2022 走看看