On Sep 11, 2011, at 10:30 AM, Adam Dershowitz, Ph.D., P.E. wrote:

> Is there any easy way to show a prior route in Flightgear?  In other words, 
> if I have a set of recorded GPS points (lat,long, alt) in a text file can I 
> display them in 3-D space, as I am flying in flightgear?  Ideally I would 
> like points (some box or sphere icon?) connected with line segments.
> There are three different approaches that occur to me, so I figured I would 
> check if anyone has done anything like this, and see if anyone can offer any 
> guidance.
> 1)  It is probably possible to generate some custom scenery that has my 
> desired path as custom made objects.  But this seems like it is likely the 
> most difficult approach?
> 
> 2)  It seems likely that it could be done with nasal, but I have really not 
> done any nasal coding.  One approach might be to hard code a bunch of 
> objects, representing points, in the right locations into a nasal file.  This 
> is not very flexible, as each nasal script would be for a given single path.
> 
> 3)  Finally, what seems most general would be to write some code in nasal 
> that can read in a csv file, and then to display objects in those locations.  
> Is this feasible?  Can nasal import a csv file or other general file format 
> that could contain points?
> 
> If any of you have any existing code, or suggestions, I would love to hear 
> it.  
> 
> Thanks,
> 
> --Adam
> 
> 
> 


I wrote some NASAL to accomplish this, and I thought that I would pass it back 
to the group, as there was some interest (Curt....), and I don't have commit 
access.

To use this, put show_points.nas into data/Nasal.
The 4 geometry files go into data/Models/geometry
and finally data is read from a csv file put in fg-aircraft.  I included a 
little sample file to show a few points.
To turn this on do:
--prop:/sim/rendering/LLpoints=1 (or change this in flight to turn it on an off)
You can change the interpolated points, between the actual points, by doing:  
--prop:/sim/rendering/LLpointsInterp=50.  By default there is effectively no 
interpolation, only the actual points are displayed.  A value of 50 will put a 
point every 50 meters, in a straight line between the existing points.
Finally, you can change the data file name (although not the path) with 
--prop:/sim/rendering/LLfile=latlong.csv (although this is the default value).  
The sample lat/long file will put a few points around SFO, just for demo 
purposes.

I hope that this is helpful.  


Attachment: show_points.nas
Description: Binary data

37.6139,-122.3586,50
37.6140,-122.3670,75
37.6137,-122.3650,100
37.6175,-122.3678,200
37.6204,-122.3739,100

Attachment: trackpoint.ac
Description: Binary data

Attachment: trackpoint.xml
Description: XML document

Attachment: volume.ac
Description: Binary data

Attachment: volume.xml
Description: XML document

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to