[osg-users] Advice on how to implement custom file format

Robert Osfield robert.osfield at gmail.com
Mon Aug 17 01:37:51 PDT 2015


Hi Aaron,

The OSG has a DatabasePager built in, something you can leverage by
creating a paged database composed of PageLOD nodes, where the PagedLOD
nodes have file references to the tiles you want to load.

You can either use files directory or encode a tile via the filename string
and have the plugin that does the loading unpack the details of what to
load.

The VirtualPlanetBuilder tool creates native OSG paged databases from DEM's
and imagery, using the PagedLOD to create a paged quad tree hierarchy of
files and subgraph they map too.

The osgEarth NodeKit also uses PagedLOD but creates the tiles on the fly
reading the DEM and imagery on demand rather than re-processing like VPB
does.

Both VPB and osgEarth provide examples of PagedLOD usage, but with the two
approaches - loading pre-processed tiles directory or using a pseudo loader.

Robert.


On 16 August 2015 at 22:11, Aaron Andersen <aaron at fosslib.net> wrote:

> Hello,
>
> I'm planning to render a custom (preexisting) map file format using osg
> and was looking for some guidance. I haven't been using osg for that long
> so I figure it is worth asking if there is either a way to adapt some
> existing code in the library to fit this custom format, or if not, what
> people might suggest as a good way to go about implementing loading and
> rendering this map file format with osg.
>
> The map is composed of individual 3d mesh tiles of variable size that are
> "snapped" together side by side somewhat similar to toy Lego blocks. Most
> mesh tiles are relatively small so there are a large number of these mesh
> tiles required to draw the map. As for the file format itself, the map is
> broken up spatially into many separate files (known as "regions").
>
> I wish to write some code so that the map will be read into my application
> and populate the scene graph seamlessly so there won't need to be a loading
> screen every time the camera zooms to a new area of the map. The maps
> stored in this format are *way* too large to load into memory all at once,
> so I will need to stream data in as the camera approaches new areas and out
> as it leaves other areas, always keeping the scene graph up to date.
>
> I should mention that the map file format is a little peculiar in that
> none of the 3d mesh tiles have any absolute position information listed at
> all. Each and every mesh tile is placed relative to the an adjacent mesh
> tile. I can arbitrarily choose any mesh tile from a map file and place it
> at 0,0,0 and from there start placing adjacent tiles, and for each adjacent
> tile place the adjacent tiles, recursively over and over, to build up the
> map. I mention this placement peculiarity because it means that I can only
> ever know the absolute position of any mesh tile that is relatively close
> to the camera (ie. the area of the map I'm currently rendering).
>
> If any clarification is required please let me know and thank you kindly
> for any advice anyone can offer me.
>
> Aaron Andersen
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150817/132d873f/attachment-0003.htm>


More information about the osg-users mailing list