55 使用OpenFlight插件
登录

使用OpenFlight插件

作者: osgChina 发布于2018-10-19 16:56:16 分类 : 用户指南

OpenFlight是 Multigen Paradigm Inc公司的一种公开格式,可以从下面链接中得到其详细信息: The OpenFlight file format specification is available for download.

OSG有一个插件名为osgdb_openflight.dll的插件,专门用来读写flt格式。和一般的OSG插件没有什么不同,在读写FLT格式时,有一些选项可以指定,使用下面命令可以列出这些选项:

osgconv --format flt

Import Option Strings

billboardCenter

Set billboard rotation point to center of face.

dofAnimation

Enable animation on DOF nodes.

readObjectRecordData

Read object records and store as osgSim::ObjectRecordData.

Texture:


clampToEdge

Use texture wrap mode CLAMP_TO_EDGE where CLAMP is specified.

noTextureAlphaForTransparancyBinning

Do not enable alpha blending based on image translucency.

Structure:


preserveFace

Preserve Face information like name and comment by translating each face record into an osg::Geode.

preserveObject

Preserve Object information.

Externals:


keepExternalReferences

Externals will be left as ProxyNodes.

cloneExternalReferences

Externals are cloned.

Units conversion:


convertToFeet

Convert units to feet.

convertToInches

Convert units to inches.

convertToMeters

Convert units to meters.

convertToKilometers

Convert units to kilometers.

convertToNauticalMiles

Convert units to miles.

noUnitsConversion

Disable units conversion. 

导出选项

version=<ver>

Specifies the version of the output FLT file. Supported values include 15.7, 15.8, and 16.1. Default is 16.1. Example: "version=15.8".

units=<units>

Specifies the contents of the c Units field of the FLT header record. Valid values include INCHES, FEET, METERS, KILOMETERS, and NATICAL_MILES. Default is METERS. Example: "units=METERS".

validate

If present in the Options string, the plugin does not write a FLT file. Instead, it returns an indication of the scene graph's suitability for FLT export.

tempDir=<path>

Specifies the directory to use for creation of temporary files. If not specified, the directory is taken from the file name. If the file doesn't contain a path, the current working directory is used. Applications should set this to the name of their app-specific temp directory. If the path contains spaces, use double quotes to ensure correct parsing. Examples: "tempDir=/tmp"; "tempDir="C:My Temp Dir"".

lighting=<value>

Specifies a default enable/disable state for lighting. By default, the exporter assumes lighting is enabled (GL_LIGHTING ON). Set this to either ON or OFF. Example: "lighting=OFF".

stripTextureFilePath

If present in the Options string, the exporter strips the path from texture file names, and writes only the texure file name to the FLT Texture Palette. By default, the exporter doesn't strip the path, and the name written to the Texture Palette is taken directly from the osg::Image object referenced by the osg::Texture2D StateAttribute. 

如果对flt格式有问题,可以在osg邮件列表中详述,并附带加上如下信息方便定位:

  • 操作的模型或其它文件

  • OSG_NOTIFY_LEVEL=INFO打开信息输出级别开关到INFO

  • 如果崩了,调用栈提供一下

一个测试套 regression test suite 用来测试将FLT导出成OSG,欢迎大家使用和贡献。

注意:FLT格式虽然公开,仍然是人家Multigen Paradigm的知识版权。