Hi,
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. After going thru the howto on the flightgear wiki, I would do
it the following way:
<view>
<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>
<eye-roll-deg-path>/orientation/roll-deg</eye-roll-deg-path>
<eye-pitch-deg-path>/orientation/pitch-deg</eye-pitch-deg-path>
<eye-heading-deg-path>/orientation/heading-deg</eye-heading-deg-path>
<at-model type="bool">true</at-model>
<at-model-idx type="int">0</at-model-idx>
<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>
<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>
</config>
</view>
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. I didn't like the idea to change some line in some
random file in order to get my additional view working. What would be the
appropriate way to add a view?
Also, the target view doesn't work as expected. Even if I have a current
waypoint defined, the camera doesn't point at it. In the command window
Flightgear constantly reports the following error:
CullVisitor::apply(Geode&) detected NaN,
Depth=-1.#IND, center=(x y z),
Matrix={
1.#QNAN 1.#QNAN 1.#QNAN
1.#QNAN 1.#QNAN 1.#QNAN
1.#QNAN 1.#QNAN 1.#QNAN}
What I am doing wrong when I try to define the target view? Can someone
comment on my code?
For my UAV simulation there will always be a stack of waypoints. However,
how can I avoid a crash, if there is no waypoint defined and therefore I
don't have a view direction?
Thanks,
Hannes
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Flightgear-users mailing list
Flightgear-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-users