Version 6 (modified by martin, 7 years ago)

--

PseudoLoader

A PseudoLoader is a type of OpenSceneGraph osgDB PlugIn.

It differs from a typical ReferenceGuides?/OsgDB file-loading plugin in that the "filename" string does not correspond to an actual file on disk, but rather the string represents parameter information for the plugin code. Thus a "pseudoloader" can be thought of as a plugin that processes "pseudo-filenames".

The main advantage of PseudoLoaders is they may be used to extend any OSG application that uses osgDB's dynamic plugin discovery mechanism. That means that any application can be extended by a PseudoLoader's capabilities with no change to the application's source code.

The core OSG currently has 3 PseudoLoaders (see the plugin source code for more documentation):

  • .trans - translates a model file by some XYZ offset; example: osgviewer cow.osg.0,0,10.trans
  • .rot - rotates a model file about the XYZ axes; example: osgviewer cow.osg.90,0,0.rot
  • .scale - scales a model file; example: osgviewer cow.osg.5.scale

The osgToy package exposes most of its functionality as PseudoLoaders, such as:

  • osgviewer 3.sponge : creates a level-3 Menger sponge fractal
  • osgviewer 20000.lorenz : creates 20000 points of a Lorenz attractor
  • osgviewer cow.osg.spin : animates a model with a simple rotation, like a pirouette.
  • osgviewer cow.osg.drawnorm : renders the model with linesegments representing the normals.
  • osgviewer cow.osg.20.simplifier : reduces a model to 20 percent of its original complexity.