Pageable OpenFlight

PageableOpenFlight is a simple utility for reading in an OpenFlight file and writing out a .osg file. The .osg file will include all the transforms and external references of the original .flt file, but will include additional nodes to enable paging of the external references.

Why would you want to do this? Often, we have gigantic OpenFlight terrain databases (a "terrain database" is a 3d model representing terrain). These terrain databases are several gigabytes, and can't fit into memory on a typical PC. These files are generated by our terrain-generation tools, with the expectation that the gigantic flt models will be converted into a IG-specific paging format. (OpenFlight, in this case, is being used as an interchange format, to feed data into a conversion tool from an IG vendor.) Often we would like to use these flt files for some quick-and-dirty visualization, but we can't because the files are too large to fit into memory. By converting the flt "index" file (usually called "master.flt") into a paging format (such as .osg), we can view the terrain without loading the entire model into memory.

Operation

The utility performs the following actions:

  1. The OpenFlight file specified on the command line is read in using fltlib, and the resulting scene graph is searched for "external reference" and transform nodes.
  2. For each external reference node found, the file referenced is read in using OpenSceneGraph. The extents (ie the dimensions, the maximum width, depth and height of the model) and center-point are retrieved from the resulting OSG scene graph. The OSG scene graph is then discarded. (Note: OSG is used for this task for two reasons: the extents of an external reference are not available in either the external reference node itself, and are not available in the header of the external flt model.)
  3. Once all the external references have been processed, an OSG scene graph (containing PagedLOD nodes, pointing to the external references, and all applicable matrix transforms) is written to disk.

Limitations

There are a number of limitations of this utility:

Dependencies

This utility requires:

FltLib
VersionFltLib hasn't (as of this writing) made a release. The current CVS version works fine.
OpenSceneGraph
VersionI'm using OSG 1.2 as of this writing.

Download

The source code can be downloaded from the project download page.

Compiling

On UNIX-like systems, running 'make' should work. OSX should be easy to support too.

Windows users are entirely on their own. If you create Visual Studio project files for this utility, you can send them to me (use the sourceforge patch submission system) and I'll include them. I can not maintain such files, however, because I do not use Windows.

Use

Run the utility from a command prompt, like so:

> cd /where/ever/you/store/your/openflight/database
> pageableOpenFlight master.flt

The output will be written to master.flt.osg

To view the results:

> osgviewer master.flt.osg

Running this utility can take a long time. You can speed things up by moving all the terrain texture files to another directory, then running the utility, then moving the textures back. This will prevent this utility from loading all the textures in the tile files (the textures aren't used by this utility anyway, so that's OK).

SourceForge

This project is hosted by SourceForge:

SourceForge.net Logo