09 April 2009

osgArchive Command Reference

Note: the OpenSceneGraph command line options on this blog were taken from version 2.8.0.

References
- An unofficial OSG FAQ is maintained by Gordon Tomlinson at 3drealtimesimulation.com. As of this posting, there are 96 FAQ's available.

osgArchive
The utility osgArchive creates and reads OpenSceneGraph database archives. These archives can then be used at runtime with standard OpenSceneGraph applications such as Osgviewer.

The osgDB library allows applications to load, use, and write 3D databases. The osgDB plugin architecture provides support for a variety of common 2D image and 3Dmodel file formats. The osgDB maintains a registry of and oversees access to the loaded OSG plugins.

OSG supports its own file formats. .osg is a plain ASCII text description of a scene graph, and .osga is an archive (or group) of osg files created by osgArchive. The osgDB library contains support code for these file formats. (OSG also supports a binary .ive format). Large 3D terrain databases are often created in sections that tile together. In this case, applications require that portions of the database load from file in a background thread without interrupting rendering. The osgDB::DatabasePager provides this functionality.

There is an OpenSceneGraph Quick Start Guide.

1. Creating a new archive
To create an archive you have to specify the archive filename, including extension, via the -a switch, and the insert 3d database and imagery files into the archive via the -i [ ..] syntax such as:

osgarchive -a archive.osga -i cow.osg glider.osg

You may also insert the contents of whole directories using the same syntax.

osgarchive -a archive.osga -i mydirectory

The .osga format also has support for a master file, which is set to the first file inserted into the archive.

2. Listing files contained in the archive
To list all the files contained specify the archive, then use the -l switch:

osgarchive -a archive.osga -l

This will print out the list of files contained within the archive.

3. Extracting files from an archive
To extract files from the archive specify the archive, then use the -e [...] syntax:

osgarchive -a archive.osga -e cow.osg

No comments: