Version 6 (modified by martin, 10 years ago)



osgconv is utility program for reading in 3d databases, apply basic operations to them, then saving out as a single 3d database.

Using osgconv to convert into native osg formats

osgconv can be very useful to read from standard 3d formats such as OpenFlight, 3DS, Alias Wavefront (OBJ) etc and then convert to an OSG native format supported such as the OpenSceneGraph .osg ascii format or .ive binary format. By default, optimization of the loaded scene graph will be peformed so the resulting scene graph written out will be smaller and faster to use at run-time, and the .ive file format is particular fast for loading making it ideal for database paging and large database.

Convert cow.obj to equivilant IVE format file:

osgconv cow.obj cow.ive

Convert cow.obj to equivilant IVE format file and compress and automatically generate mipmapped textures:

osgconv --compressed cow.obj cow.ive

Command line options available

For a full list of command line options supported type:

osgconv --help

Which will print out out the following:


osgconv [options] infile1 [infile2 ...] outfile


-O option ReaderWriter option
--compressed Compress textures.
--compressed Enable the usage of compressed textures.
--compressed-arb Enable the usage of [=OpenGL=] ARB compressed textures
--compressed-dxt1 Enable the usage of [=S3TC DXT1=] compressed textures
--compressed-dxt3 Enable the usage of [=S3TC DXT3=] compressed textures
--compressed-dxt5 Enable the usage of [=S3TC DXT5=] compressed textures
-l libraryName load plugin of name libraryName i.e. -l osgdb_pfb
Useful for loading reader/writers which can load other file formats in addition to its extension.
-e extensionName load reader/wrter plugin for file extension i.e. -e pfb
Useful short hand for specifying full library name as done with -l above, as it automatically expands to the full library name appropriate for each platform.
-o orientation Convert geometry from input files to output files.
Format of orientation argument must be the following:


where X1,Y1,Z1 represent the UP vector in the input files and X2,Y2,Z2 represent the UP vector of the output file, or degrees is the rotation angle in degrees around axis (A0,A1,A2). For example, to convert a model built in a Y-Up coordinate system to a model with a Z-up
coordinate system, the argument may look like

-t translation Convert spatial position of output files. Format of translation argument must be the following :


where X, Y, and Z represent the coordinates of the absolute position in world space
-s scale - Scale size of model. Scale argument must be the following :


where SX, SY, and SZ represent the scale factors. Caution: Scaling will be done in destination orientation