Howto:Set view points: Difference between revisions

Jump to navigation Jump to search
m
Robot: Cosmetic changes
No edit summary
m (Robot: Cosmetic changes)
Line 1: Line 1:
This [[:Category:Howto|howto]] teaches you '''how to set (custom) view points''' for your [[aircraft]](s). In sim, the user can switch between various view points, by pressing the v/V keys.
This [[:Category:Howto|howto]] teaches you '''how to set (custom) view points''' for your [[aircraft]](s). In sim, the user can switch between various view points, by pressing the v/V keys.


==Default views==
== Default views ==
Various default views are defined in <tt>[[$FG_ROOT]]/preferences.xml</tt> and are used when there is no custom view defined for a certain view-number.  
Various default views are defined in <tt>[[$FG ROOT]]/preferences.xml</tt> and are used when there is no custom view defined for a certain view-number.  


==Custom views==
== Custom views ==
It is possible to configure any number of views with [[XML]] configuration files. Views may be configured to switch between pilot and co-pilot, tower view, or view of an observer on the ground.
It is possible to configure any number of views with [[XML]] configuration files. Views may be configured to switch between pilot and co-pilot, tower view, or view of an observer on the ground.


All of the codes mentioned in this article, should be placed between the <sim> and </sim> tag of your aircraft's [[Howto:_Make_an_aircraft#The_-set.xml_file|-set.xml]] file.
All of the codes mentioned in this article, should be placed between the <sim> and </sim> tag of your aircraft's [[Howto: Make an aircraft#The -set.xml file|-set.xml]] file.


  <view n="0">
  <view n="0">
Line 46: Line 46:
** '''lookfrom''' most resemblance to the human head (you look around from a fixed point). Used for pilot view.
** '''lookfrom''' most resemblance to the human head (you look around from a fixed point). Used for pilot view.
* '''internal'''
* '''internal'''
*'''config''' Open the aircraft in a [[Modeling_-_Getting_Started#3D_Software|3D editor]] to find these coordinates, or open the [[property browser]] in sim and edit the <tt>/sim/current-view properties</tt> for live feedback.
* '''config''' Open the aircraft in a [[Modeling - Getting Started#3D Software|3D editor]] to find these coordinates, or open the [[property browser]] in sim and edit the <tt>/sim/current-view properties</tt> for live feedback.
**'''?-offset-m''' the offset from the origin of your aircraft, in meters.  
** '''?-offset-m''' the offset from the origin of your aircraft, in meters.  
**'''pitch-offset-deg''' the pitch of the view.
** '''pitch-offset-deg''' the pitch of the view.
**'''default-field-of-view-deg''' the larger this number, the wider the view. Around 55-65 is the most common setting.
** '''default-field-of-view-deg''' the larger this number, the wider the view. Around 55-65 is the most common setting.
*'''dynamic'''
* '''dynamic'''
**'''enabled''' when set to true, this enables dynamic view, which rotates the view based on control input (to simulate a pilot looking into the direction he steers to).
** '''enabled''' when set to true, this enables dynamic view, which rotates the view based on control input (to simulate a pilot looking into the direction he steers to).
* '''limits''' you can limit the view movements, in order to simulate the fact that a human is unable to turn its head 360 degrees.
* '''limits''' you can limit the view movements, in order to simulate the fact that a human is unable to turn its head 360 degrees.
**'''enabled''' set to true to enable limits.
** '''enabled''' set to true to enable limits.
**'''left/right'''
** '''left/right'''
***'''heading-max-deg'''
*** '''heading-max-deg'''
***'''x-offset-max-m'''
*** '''x-offset-max-m'''
***'''x-offset-threshold-deg'''
*** '''x-offset-threshold-deg'''


Additionally, you can place the following line after the last </view> tag. It is used to define the distance to the aircraft of the default views: chase, helicopter and  
Additionally, you can place the following line after the last </view> tag. It is used to define the distance to the aircraft of the default views: chase, helicopter and  
  <chase-distance-m type="double" archive="y">-90.0</chase-distance-m>
  <chase-distance-m type="double" archive="y">-90.0</chase-distance-m>


===View numbers===
=== View numbers ===
Each view point must have an unique id/number. If no number is set, numbers are assigned from 0 to n in order of existance in the .xml file. Numbers can be overriden by using the following line (where 1 can be any number):
Each view point must have an unique id/number. If no number is set, numbers are assigned from 0 to n in order of existance in the .xml file. Numbers can be overriden by using the following line (where 1 can be any number):
  <view n="1">  
  <view n="1">  
Line 69: Line 69:
Note that the view numbers do have impact on the order of views when skipping through them in sim with the v/V keys.
Note that the view numbers do have impact on the order of views when skipping through them in sim with the v/V keys.


===Examples===
=== Examples ===
====Chase view with fixed roll/pitch degrees====
==== Chase view with fixed roll/pitch degrees ====
The configuration of a chase view without a rotating frutstum (the view does not tilt with the aircraft's roll and pitch) is easy. Since the aircraft model's orientation is contained in its location definition, you must set the from-model property to false so you may define your own source for position and orientation. Then define eye position properties for the appropriate values. If you leave eye-roll-deg and eye-pitch-deg out then they will be fixed at 0 degrees. Note that technically this example does rotate, but only on the heading.  
The configuration of a chase view without a rotating frutstum (the view does not tilt with the aircraft's roll and pitch) is easy. Since the aircraft model's orientation is contained in its location definition, you must set the from-model property to false so you may define your own source for position and orientation. Then define eye position properties for the appropriate values. If you leave eye-roll-deg and eye-pitch-deg out then they will be fixed at 0 degrees. Note that technically this example does rotate, but only on the heading.  


Line 95: Line 95:
   </view>
   </view>


====Tower view====
==== Tower view ====
   <view>
   <view>
     <name>Tower View</name>
     <name>Tower View</name>

Navigation menu