[osg-users] Advice on how to implement custom file format
Aaron Andersen
aaron at fosslib.net
Sun Aug 16 14:11:27 PDT 2015
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
More information about the osg-users
mailing list