On Sun, 22 Sep 2002 07:53:34 -0400 David Megginson <[EMAIL PROTECTED]> wrote:
> For a while now, FlightGear has had support for adding static scenery > objects (like buildings) to *.stg scenery files using the syntax > > OBJECT_STATIC <file> <lon> <lat> <elevation-m> <heading> > > The file is always loaded relative to the current scenery directory > (such as /usr/local/scenery/w080n40/w077n45), which is great for > one-off objects like the Golden Gate Bridge or the Empire State > Building, but not so useful for objects like radio towers, barns, > etc. that can be used over and over. > > I have just added a new directive, OBJECT_SHARED, that works exactly > like the above except that it loads the object relative to $FG_ROOT > rather than the current scenery directory. For example, I have my > $FG_ROOT at /usr/local/FlightGear/ and my $FG_SCENERY at > /usr/local/Scenery. If I add this line to w080n40/w077n45/1696211.stg > > OBJECT_STATIC red-barn.ac -76.022499 45.319500 200 0 > > FlightGear will attempt to load > > /usr/local/Scenery/w080n40/w077n45/red-barn.ac > > On the other hand, if I have > > OBJECT_SHARED Models/Buildings/red-barn.ac -76.022499 45.319500 200 0 > > FlightGear will attempt to load > > /usr/local/FlightGear/Models/Buildings/red-barn.ac > Excellent! Hopefully this will work for texture files referenced by the object. FWIW I'm working on importing XPlane custom objects and many of them share textures. I already have the SFO terminal and Golden Gate bridge loading. > The big challenge right now is figuring out what tile to add an object > to -- I will try to whip up a Perl script to help with this. Once > that's working, we can automatically add all NDB towers and VOR > transmitters from our current data and populate the world a little > more; one user has a copy of the FAA obstacle database, and that would > allow us even more detail in the U.S. > The following c++ program prints the tile name given a lat/lon. [bbright@proton FlightGear-0.7]$ cat latlon.cxx #include <iostream> #include <cstdlib> #include <simgear/bucket/newbucket.hxx> using std::cout; int main( int argc, char* argv[] ) { if (argc != 3) { cout << "Usage: " << argv[0] << " <lat> <lon>\n"; return 1; } double dlat = atof( argv[1] ); double dlon = atof( argv[2] ); SGBucket b( dlon, dlat ); cout << b.gen_base_path() << "/" << b.gen_index_str() << "\n"; return 0; } _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel