FGCamera: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(→‎Installation: Cleanup)
(Cleanup)
Line 102: Line 102:
{{#ev:youtube|x-JPzLox-gI|300}}
{{#ev:youtube|x-JPzLox-gI|300}}


== POV hat binding example ==
<syntaxhighlight lang="xml">
  <!-- Bottom stick hat -->
  <axis>
      <number>
        <mac>7</mac>
        <unix>7</unix>
        <windows>6</windows>
      </number>
      <desc>View Direction</desc>
      <binding>
        <command>property-scale</command>
        <property>/data/hat-H</property>
        <factor type="double">-1.0</factor>
      </binding>
      <binding>
        <command>nasal</command>
        <script>
            <![CDATA[
              var hat_H = getprop("/data/hat-H");
              fgcamera.point.adjust("h", hat_H);
            ]]>
        </script>
      </binding>
  </axis>
  <axis>
      <number>
        <mac>8</mac>
        <unix>8</unix>
        <windows>7</windows>
      </number>
      <desc>View Elevation</desc>
      <binding>
        <command>property-scale</command>
        <property>/data/hat-V</property>
        <factor type="double">1.0</factor>
      </binding>
      <binding>
        <command>nasal</command>
        <script>
            <![CDATA[
              var hat_V = getprop("/data/hat-V");
              fgcamera.point.adjust("p", hat_V);
 
            ]]>
        </script>
      </binding>
  </axis>
</syntaxhighlight>
== Used TrackIR and PPJoy (virtual joystick) combination ==
<syntaxhighlight lang="xml">
<?xml version="1.0"?>
<PropertyList>
<axis n="0">
  <desc>6DOFYaw</desc>
  <tolerance>0.00001</tolerance>
  <binding>
  <command>property-scale</command>
  <property>/sim/TrackIR/heading-deg</property>
  <factor type="double">-180.0</factor>
  </binding>
</axis>
<axis n="1">
  <desc>6DOFPitch</desc>
  <tolerance>0.00001</tolerance>
  <binding>
  <command>property-scale</command>
  <property>/sim/TrackIR/pitch-deg</property>
  <factor type="double">-100.0</factor>
  </binding>
</axis> 
<axis n="2">
  <desc>6DOFRoll</desc>
  <tolerance>0.00001</tolerance>
  <binding>
  <command>property-scale</command>
  <property>/sim/TrackIR/roll-deg</property>
  <factor type="double">-100.0</factor>
  </binding>
</axis>
<axis n="3">
  <desc>6DOFX</desc>
  <tolerance>0.00001</tolerance>
  <binding>
  <command>property-scale</command>
  <property>/sim/TrackIR/x-m</property>
  <factor type="double">-0.5</factor>
  </binding>
</axis>
  <axis n="4">
  <desc>6DOFY</desc>
  <tolerance>0.00001</tolerance>
  <binding>
  <command>property-scale</command>
  <property>/sim/TrackIR/y-m</property>
  <factor type="double">0.5</factor>
  </binding>
</axis>
 
  <axis n="5">
  <desc>6DOFZ</desc>
  <tolerance>0.00001</tolerance>
  <binding>
  <command>property-scale</command>
  <property>/sim/TrackIR/z-m</property>
  <factor type="double">0.5</factor>
  </binding>
  </axis>
 
</PropertyList>
<!-- end of PPJoy.xml -->
</syntaxhighlight>


== Support ==
== Support ==

Revision as of 08:18, 13 August 2014

FGCamera v1.0 in action

FGCamera is an alternative FlightGear view system that adds features similar to „EZdok Camera Addon“ for Flight Simulator X. FGCamera is written in Nasal.


Currently available features:

  • 4 camera types:
    • Virtual cockpit,
    • Aircraft (look-at),
    • Aircraft (look-from),
    • World (look-from);
  • Arbitrary number of preset views;
  • Smooth/discrete transition between the views of the same camera type.

Download link / Installation

  1. Download fgcamera_v1.rar
  2. Delete (if exist) FG HOME/aircraft-data/FGCamera;
  3. Delete (if exist) FG ROOT/Nasal/fgcamera;
  4. Copy fgcamera folder (from downloaded archive) to FG ROOT/Nasal;
  5. Use FG ROOT/Nasal/fgcamera/fgcamera_cfg as config.

User Interface

Fgcamera menu item.jpg

Graphical user interface is used to create and manage camera views. FGCamera dialogs can be launched using menubar item View/FGCamera (experimental).

Currently, there are three functional dialogs:

  • Main,
  • Camera creation,
  • Current camera settings.

Main Dialog

Fgcamera main dialog.jpg
  • "Options" button opens FGCamera's global settings dialog. This dialog is currently non functional.
  • "Create new camera..." button opens new camera creation dialog.
  • The list of cameras shows all the camera views that are created for the currently selected aircraft. Each camera view has its own index. The active view (currently selected view) is marked by square brackets.
  • The active view can be renamed using input box below the list of cameras.
  • Buttons "U" and "D" are used to rearrange camera views.
  • "Delete" button removes the active camera.
  • "Save" button saves all the cameras data to disk.
  • "Close" closes the dialog (changes will not be saved to disk).

Camera Creation Dialog

Fgcamera new camera dialog.jpg
  • "Camera type" popup list is used to select camera type. Supported types:
    • cockpit,
    • aircraft (look at),
    • aircraft (look from),
    • world (look from);
  • "Create" – creates new camera view and selects it as an active camera.
  • "Cancel" – closes the dialog.

"Current camera settings" Dialog

Fgcamera camera settings dialog.jpg
  • FOV – field of view;
  • View movement – group of inputs that controls view movement between preset views:
    • Transition time – time to move camera from current position to preset position.
  • View adjustment – group of inputs that controls view adjustment behaviour:
    • Linear velocity – translational velocity of camera in meters per second,
    • Angular velocity – angular velocity of camera in degrees per second.
    • Lowpass filter – "smoothness" of the camera movement.
  • Mouse look – group of inputs that controls mouse look behaviour:
    • Mouse sensitivity – self explanatory,
    • Lowpass filter – "smoothness" of the camera movement.
  • "Apply" saves current camera position (does not write to disk).
  • "Cancel" – closes the dialog (current camera position will not be saved).

Controls

Preconfigured keys

  • select preset views: 1, 2, 3, 4, 5, 6, 7, 8, 9, 0.
  • adjust camera position: , , , , Page Up, Page Down.
Noteto People using keyboard to fly (with or without mouse): throttle keys aren't working with the camera

Key assignments can be customized by editing FGROOT/Nasal/fgcamera/fgcamera_cfg.xml

Commands

fgcamera-select

WIP.png Work in progress
This article or section will be worked on in the upcoming hours or days.
See history for the latest developments.

fgcamera-adjust

WIP.png Work in progress
This article or section will be worked on in the upcoming hours or days.
See history for the latest developments.

Development status (Aug 2014)

  • 20}% completed Dynamic view movement;
  • 40}% completed Random camera movement (effects);
  • Not done Not done Alternative config (presets) that supports "keyboard+mouse" flight controls.

Gallery


Support

FGCamera forum thread