* Hannes Schweikl -- Tuesday 05 May 2009:
> I am trying to define an additional view which is looking from the current
> aircraft position to the waypoint (lon,lat)@ground-elevation the aircraft is
> approaching.

Try this:

  <view n="1000">
    <name>Target View</name>
    <enabled type="bool" userarchive="y">true</enabled>
    <type>lookat</type>
    <config>
      <from-model type="bool">false</from-model>
      <from-model-idx type="int">0</from-model-idx>
      <eye-lat-deg-path>/position/latitude-deg</eye-lat-deg-path>
      <eye-lon-deg-path>/position/longitude-deg</eye-lon-deg-path>
      <eye-alt-ft-path>/position/altitude-ft</eye-alt-ft-path>
      <at-model type="bool">false</at-model>
      <at-model-idx type="int">0</at-model-idx>
      
<target-lat-deg-path>/autopilot/route-manager/route/wp/latitude-deg</target-lat-deg-path>
      
<target-lon-deg-path>/autopilot/route-manager/route/wp/longitude-deg</target-lon-deg-path>
      <target-alt-ft-path>/position/ground-elev-ft</target-alt-ft-path>
      <x-offset-m type="double">0</x-offset-m>
      <y-offset-m type="double">0</y-offset-m>
      <z-offset-m type="double">0</z-offset-m>
      <ground-level-nearplane-m type="double">10.0f</ground-level-nearplane-m>
      <default-field-of-view-deg type="double">55.0</default-field-of-view-deg>
    </config>
  </view>

Obviously, the ground elevation is a problem. It's the aircraft's, not the
target point's. You can use Nasal's geo.elevation() function to determine
that. A view handler could update it whenever necessary.



> I added these lines to preferences.xml. After adding that, I had to change
> line 530 in view.nas to: if (index > 7 and index < 100) in order to get rid
> of a nasal error caused by the increased # of views. I am not sure, if that
> is the way to go to.

No, as Ron wrote already, the first 100 views are reserved. (It was necessary
to enforce that, as people wouldn't respect it otherwise, and that would cause
lots of work later. Been there, done that.) Aircraft use views with indices
100++, but higher numbers are free for local extensions. Let's say >=1000.

m.

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Flightgear-users mailing list
Flightgear-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-users

Reply via email to