Let me try to hijack this thread to ask a related question:

How do I get the altitude of the ground at a given location?

I have a simple little tool that prints the base path and index for a
given longitude and latitude pair.  Is there a simgear function to load
the associated .btg.gz terrain file and find the elevation at the given
point?  Or should I be looking at flightgear for an example?  I'd like
to keep the program quick and simple...  Ultimate goal is automated
object placement.

Or am I re-inventing a wheel here?

Thanks,

Ron

//g++ fgbucket.cpp -lsgbucket -lsgmisc -lsgprops -lsgstructure -lsgxml -lz -lsgdebug -ofgbucket


#include <simgear/compiler.h>
#include <simgear/bucket/newbucket.hxx>
#include <simgear/misc/sg_path.hxx>

#include <iostream>

#include SG_GLUT_H

#include <plib/ssg.h>

using std::cout;
using std::cerr;
using std::endl;

/*
#include <iostream>
#include <stdio.h>
*/

int main(int argc, char *argv[])
{
	double dlong=-111.89195, dlat=40.77037;

	if(argc!=3)
	{
		cerr<<"Usage:\n"<<argv[0]<<" latitude longitude\n";
		exit(1);
	}

	dlong=strtod(argv[2], NULL);
	dlat=strtod(argv[1], NULL);

	SGBucket myBucket;
	myBucket.set_bucket( dlong, dlat);

//cout<<myBucket<<'\n';

	cout<<myBucket.gen_base_path()<<"/"<<myBucket.gen_index()<<".stg\n";

}
-------------------------------------------------------------------------
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