[osg-users] Reading and writing files
serge.lages at gmail.com
Thu Oct 11 08:27:45 PDT 2007
On 10/11/07, James Dickson <james.dickson at gmail.com> wrote:
> 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
Thank you for any help,
> James Dickson
> osg-users mailing list
> osg-users at lists.openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the osg-users