[osg-users] Reading and writing files

Serge Lages serge.lages at gmail.com
Thu Oct 11 08:27:45 PDT 2007

Hi James,

On 10/11/07, James Dickson <james.dickson at gmail.com> wrote:
> Hi,
> I have a quick question about reading and writing files using OSG. I have
> read the tutorial about reading files, but I would like to be able to read
> my own file format by maybe writing the necessary plugin. Could someone
> point me in the direction of how I might be able to do this?

The best way to find how plugins work is to directly look at them. In the
source (src\osgPlugins\) you'll find that each plugins implements a Reader
Writer class. To make your own plugin you'll need to do the same thing.

Secondly I want to be able to write to an alias wavefront .OBJ file. I
> understand again from the reading files tutorial that a plugin for this
> exists, but do I need to somehow specify that this plugin should be used?
> Could someone maybe give a little example of writing to a file?

You don't need to specify it, it will be dynamically loaded if you try to
read or write a file with the .obj extension. But take care that some
plugins can only read and not write. The best way to know if you can write
files with a plugin is to look at its code and check if the writeNode method
is implemented.

Thank you for any help,
> James
> --
> James Dickson
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Serge Lages
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20071011/6cb34bb4/attachment-0003.htm>

More information about the osg-users mailing list