[osg-users] [osgPlugins] custom file

Robert Osfield robert.osfield at gmail.com
Thu Oct 12 07:07:52 PDT 2017


Hi Hakan,

On 12 October 2017 at 13:32, Hakan Gedek <hgedek at gmail.com> wrote:

> At an old project we wish to move render platfrom to osg. The files
> associated with project have a custom format - it's more complicated than
> .obj file :((
>
> Is there any example i can follow or just should i give up ?
>

The OSG has over a hundred plugins for loading different types of image and
3d data, it's all open source, so there are plenty of real examples.   Each
of these plugins provide one or more ReaderWriter subclasses that override
the appropriate readNode/readImage() method to provide the hook to loading
a file.

You can write a loader in the form of a plugin or just compile it directly
into your application - the proxy object registration of ReaderWriter works
in exactly the same way regardless of whether it's loaded as a plugin or
compiled directly into an application.

So the hooks to getting the OSG to call your custom ReaderWriter are pretty
minimal and straight forward - just look at the obj loader for example, so
the bulk of the work will be parsing the file format and then converting
the loaded data over into OSG specific data structures.  This part we can't
help directly with - only your and your team know the specifics of your
file format and what type of data it represents.

Robert.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20171012/749c31ec/attachment.html>


More information about the osg-users mailing list