Hi,

I am trying to understand the SGBinObject binary format (BTG files) and for
this purpose I wrote a short test program to load a file and save it back to
disk.

    SGBinObject source;
    bool result = source.read_bin
("S:\\scenery\\Terrain\\w090n30\\w087n39\\1532019.btg");
    if (result == true)
    {
        SGBucket bucket(SGGeod::fromCart(SGVec3<double>(
source.get_gbs_center2().sg())));
        source.write_bin("C:\\", "test.btg", bucket);
    }

This code loads the largest (non-airport) BTG file from the World scenery
disk 1 (mounted on drive S: on Windows) and tries to save it back.

The program crashes in line 1015 of sg_binobj.cxx trying to access the
member variable fans_n[i][j]  with a "vector subscript out of range" debug
error inside the STL vector class.

I was kind of wondering if my use of write_bin is incorrect, or if there is
a serious bug in the write_bin() implementation. Maybe this function is used
so seldom that no-one noticed so far?

I was trying this on Windows based on the CVS/HEAD SimGear release under
Visual C++ 2005 Express Edition. The flightgear binary produced with this
compiler works just fine.

My mid term goal is to come up with a more efficiently compressed binary
format to save some disk space and possible squeeze the world scenery on two
DVDs or less. I plan to achieve this goal by using some quantization and
entropy coding. It might also be possible to obtain some LOD support by
encoding the mesh progressively (i.e. from coarse to full precision) and by
specifying a cutoff point during read_bin()
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to