FlightGear Newsletter May 2015: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(A bit of cleanup)
Line 1: Line 1:
{{draft|newsletter|Please feel free to add content you think will be of interest to the FlightGear community. You can read the latest newsletter at [[FlightGear Newsletter March 2015]].}}


{{Newsletter-header|May 2015}}
{{Newsletter-header|May 2015}}
Line 5: Line 6:
  | valign="top" width="33%" |
  | valign="top" width="33%" |
{{Newsletter-cover-header|Development news}}<br/>
{{Newsletter-cover-header|Development news}}<br/>
[[#Automated Checklist Execution|Automated Checklist Execution]]<br/>
[[#Exhaust flames|Exhaust flames]]<br/>
[[#Automated checklist execution|Automated checklist execution]]<br/>
[[#Nasal/Canvas: A simple tiled map|Nasal/Canvas: A simple tiled map]]
[[#Nasal/Canvas: A simple tiled map|Nasal/Canvas: A simple tiled map]]
  | valign="top" width="33%" |
  | valign="top" width="33%" |
Line 19: Line 21:
[[#Screenshots|Screenshots]]
[[#Screenshots|Screenshots]]
|}</div>
|}</div>


== Development News ==
== Development News ==
=== Exhaust flames ===
=== Exhaust flames ===
The latest addition to the Atmospheric Light Scattering framework is  a procedural shader effect to render thruster and afterburner exhaust flames. This effect integrates over a 3d-distribution of glowing emitters in a bounding box, which means that it doesn't generate sharp edges in the visuals.
The latest addition to the Atmospheric Light Scattering framework is  a procedural shader effect to render thruster and afterburner exhaust flames. This effect integrates over a 3d-distribution of glowing emitters in a bounding box, which means that it doesn't generate sharp edges in the visuals.


Line 36: Line 33:
[[File:Shuttle flame06.jpg|400px|Space Shuttle main engine flames during late ascent]]
[[File:Shuttle flame06.jpg|400px|Space Shuttle main engine flames during late ascent]]


=== Automated Checklist Execution ===
=== Automated checklist execution ===
 
{{FGCquote
{{FGCquote
   |As part of the development of the Lockheed 1049h Constellation, I created a comprehensive set of checklists based on the crew operating manual with other items added sufficient to take the aircraft through all stages of flight. Rather than hand-code an autostart script I wrote a more generic script to run checklist bindings in sequence. This script is now available in FGDATA and can be used on other aircraft:<br/>
   |As part of the development of the Lockheed 1049h Constellation, I created a comprehensive set of checklists based on the crew operating manual with other items added sufficient to take the aircraft through all stages of flight. Rather than hand-code an autostart script I wrote a more generic script to run checklist bindings in sequence. This script is now available in FGDATA and can be used on other aircraft:<br/>
Line 54: Line 50:


=== Nasal/Canvas: A simple tiled map ===
=== Nasal/Canvas: A simple tiled map ===
Using the [[Canvas GUI]], you can make a simple tiled map using images downloaded on the fly  You can view the code behind the map at [[Canvas Snippets#A simple tile map]].


 
[[File:Canvas - Tile map demo.png|A simple, canvas based tile map which is centered around the aircraft.]]
{| class="wikitable"
|-
! Screenshot !! Code
|-
| [[File:Canvas - Tile map demo.png|thumb|500px|A simple, canvas based tile map which is centered around the aircraft.]]
|
<syntaxhighlight lang="nasal" enclose="div">
var (width,height) = (768,512);
var tile_size = 256;
 
var window = canvas.Window.new([width, height],"dialog")
                  .set('title', "Tile map demo");
var g = window.getCanvas(1)
              .createGroup();
 
# Simple user interface (Buttons for zoom and label for displaying it)
var zoom = 10;
var type = "map";
 
var ui_root = window.getCanvas().createGroup();
var vbox = canvas.VBoxLayout.new();
window.setLayout(vbox);
 
 
var button_in = canvas.gui.widgets.Button.new(ui_root, canvas.style, {})
                                  .setText("+")
                                  .listen("clicked", func changeZoom(1));
var button_out = canvas.gui.widgets.Button.new(ui_root, canvas.style, {})
                                  .setText("-")
                                  .listen("clicked", func changeZoom(-1));
button_in.setSizeHint([32, 32]);
button_out.setSizeHint([32, 32]);
 
var label_zoom = canvas.gui.widgets.Label.new(ui_root, canvas.style, {});
 
var button_box = canvas.HBoxLayout.new();
button_box.addItem(button_in);
button_box.addItem(label_zoom);
button_box.addItem(button_out);
button_box.addStretch(1);
 
vbox.addItem(button_box);
vbox.addStretch(1);
 
var changeZoom = func(d)
{
  zoom = math.max(2, math.min(19, zoom + d));
  label_zoom.setText("Zoom " ~ zoom);
  updateTiles();
}
 
# http://polymaps.org/docs/
# https://github.com/simplegeo/polymaps
# https://github.com/Leaflet/Leaflet
 
var maps_base = getprop("/sim/fg-home") ~ '/cache/maps';
 
# http://otile1.mqcdn.com/tiles/1.0.0/map
# http://otile1.mqcdn.com/tiles/1.0.0/sat
# (also see http://wiki.openstreetmap.org/wiki/Tile_usage_policy)
var makeUrl =
  string.compileTemplate('http://otile1.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.jpg');
var makePath =
  string.compileTemplate(maps_base ~ '/osm-{type}/{z}/{x}/{y}.jpg');
var num_tiles = [4, 3];
 
var center_tile_offset = [
  (num_tiles[0] - 1) / 2,
  (num_tiles[1] - 1) / 2
];
 
# simple aircraft icon at current position/center of the map
g.createChild("path")
.moveTo( tile_size * center_tile_offset[0] - 10,
          tile_size * center_tile_offset[1] )
.horiz(20)
.move(-10,-10)
.vert(20)
.set("stroke", "red")
.set("stroke-width", 2)
.set("z-index", 1);
 
##
# initialize the map by setting up
# a grid of raster images 
 
var tiles = setsize([], num_tiles[0]);
for(var x = 0; x < num_tiles[0]; x += 1)
{
  tiles[x] = setsize([], num_tiles[1]);
  for(var y = 0; y < num_tiles[1]; y += 1)
    tiles[x][y] = g.createChild("image", "map-tile");
}
 
var last_tile = [-1,-1];
var last_type = type;
 
##
# this is the callback that will be regularly called by the timer
# to update the map
var updateTiles = func()
{
  # get current position
  var lat = getprop('/position/latitude-deg');
  var lon = getprop('/position/longitude-deg');
 
  var n = math.pow(2, zoom);
  var offset = [
    n * ((lon + 180) / 360) - center_tile_offset[0],
    (1 - math.ln(math.tan(lat * math.pi/180) + 1 / math.cos(lat * math.pi/180)) / math.pi) / 2 * n - center_tile_offset[1]
  ];
  var tile_index = [int(offset[0]), int(offset[1])];
 
  var ox = tile_index[0] - offset[0];
  var oy = tile_index[1] - offset[1];
 
  for(var x = 0; x < num_tiles[0]; x += 1)
    for(var y = 0; y < num_tiles[1]; y += 1)
      tiles[x][y].setTranslation(int((ox + x) * tile_size + 0.5), int((oy + y) * tile_size + 0.5));
 
  if(    tile_index[0] != last_tile[0]
      or tile_index[1] != last_tile[1]
      or type != last_type )
  {
    for(var x = 0; x < num_tiles[0]; x += 1)
      for(var y = 0; y < num_tiles[1]; y += 1)
      {
        var pos = {
          z: zoom,
          x: int(offset[0] + x),
          y: int(offset[1] + y),
          type: type
        };
 
        (func {
        var img_path = makePath(pos);
        var tile = tiles[x][y];
 
        if( io.stat(img_path) == nil )
        { # image not found, save in $FG_HOME
          var img_url = makeUrl(pos);
          print('requesting ' ~ img_url);
          http.save(img_url, img_path)
              .done(func {print('received image ' ~ img_path); tile.set("src", img_path);})
              .fail(func (r) print('Failed to get image ' ~ img_path ~ ' ' ~ r.status ~ ': ' ~ r.reason));
        }
        else # cached image found, reusing
        {
          print('loading ' ~ img_path);
          tile.set("src", img_path)
        }
        })();
      }
 
    last_tile = tile_index;
    last_type = type;
  }
};
 
##
# set up a timer that will invoke updateTiles at 2-second intervals
var update_timer = maketimer(2, updateTiles);
# actually start the timer
update_timer.start();
 
##
# set up default zoom level
changeZoom(0);
</syntaxhighlight>
|}


== Scenery Corner ==
== Scenery Corner ==
Line 240: Line 67:
=== Translators required ===
=== Translators required ===
{|
{|
| [[File:cat.gif]]
| La wiki de FlightGear encara necessita ajuda per traduir-la a diverses llengües. Si esteu interessat en fer la wiki de FlightGear multilingüe, llavors comenceu a [[:ca:Help:Traduir|Help:Traduir]].
|-
| [[File:en.gif]]
| [[File:en.gif]]
| The FlightGear Wiki still needs help for translating it into various languages. If you are interested in making the FlightGear Wiki multi-language then start at [[Help:Translate]].
| The FlightGear Wiki still needs help for translating it into various languages. If you are interested in making the FlightGear Wiki multi-language then start at [[Help:Translate]].
Line 254: Line 78:
| [[File:es.gif]]
| [[File:es.gif]]
| La wiki de FlightGear todavía necesita ayuda para traducirla a varios lenguajes. Si estás interesado en hacer la FlightGear wiki multilingüe, entonces comienza en [[:es:Help:Traducir|Help:Traducir]].
| La wiki de FlightGear todavía necesita ayuda para traducirla a varios lenguajes. Si estás interesado en hacer la FlightGear wiki multilingüe, entonces comienza en [[:es:Help:Traducir|Help:Traducir]].
|-
| [[File:cat.gif]]
| La wiki de FlightGear encara necessita ajuda per traduir-la a diverses llengües. Si esteu interessat en fer la wiki de FlightGear multilingüe, llavors comenceu a [[:ca:Help:Traduir|Help:Traduir]].
|}
|}


Line 261: Line 88:
=== Screenshots ===
=== Screenshots ===
The FlightGear project always needs screenshots, which show features that were added since the last release.  These should be of good quality, especially in content and technical image properties.  It is therefore recommended to use the best viable filter settings ([[anti-aliasing]], texture sharpening, etc.).  More info at [[Howto:Make nice screenshots]].
The FlightGear project always needs screenshots, which show features that were added since the last release.  These should be of good quality, especially in content and technical image properties.  It is therefore recommended to use the best viable filter settings ([[anti-aliasing]], texture sharpening, etc.).  More info at [[Howto:Make nice screenshots]].
{{Appendix}}


[[Category:FlightGear Newsletter|2015 05]]
[[Category:FlightGear Newsletter|2015 05]]
[[Category:Changes after 3.4]]
[[Category:Changes after 3.4]]

Revision as of 07:32, 23 May 2015

This newsletter is a draft.

Please feel free to add content you think will be of interest to the FlightGear community. You can read the latest newsletter at FlightGear Newsletter March 2015.


Magagazine.png
Enjoy reading the latest edition!
Please help us write the coming edition!
May 2015

Development news
Exhaust flames
Automated checklist execution
Nasal/Canvas: A simple tiled map

In the hanger
Scenery Corner
Scenery Project Elba
Community News
The Festival of FlightGear 2015 (1/2) - 2 & 3 May

Contributing
Translators required
FlightGear logos
Screenshots

Development News

Exhaust flames

The latest addition to the Atmospheric Light Scattering framework is a procedural shader effect to render thruster and afterburner exhaust flames. This effect integrates over a 3d-distribution of glowing emitters in a bounding box, which means that it doesn't generate sharp edges in the visuals.

Flame color, density, distribution of shock diamonds and widening in thin atmosphere are all runtime configurable, allowing to account realistically for changed thrust or ambient pressure.

Here's an example application for the Space Shuttle main engine - note how the exhaust plume is narrow early on and shows pronounced shock diamonds while it widens in the thin upper atmosphere:

Space Shuttle main engine flames during early ascent Space Shuttle main engine flames during late ascent

Automated checklist execution

Cquote1.png As part of the development of the Lockheed 1049h Constellation, I created a comprehensive set of checklists based on the crew operating manual with other items added sufficient to take the aircraft through all stages of flight. Rather than hand-code an autostart script I wrote a more generic script to run checklist bindings in sequence. This script is now available in FGDATA and can be used on other aircraft:


Wiki: Automated Checklist Execution

If you are thinking about writing an autostart menu, you might want to consider using this script and driving the autostart from the checklists. It's not restricted to autostart, you can essentially run any sequence of checklists from any piece of Nasal code.

You can see the script in action in the latest Lockheed 1049h. Note that you need a recent copy of FGDATA for this to work. The autostart in this case is intelligent enough to run different checklist sequences depending on whether you are starting on a runway, at the terminal or in the air and also uses automated checklist execution to run an "After Landing" checklist from a keyboard shortcut during that busy time of rollout and taxi.


— sanhozay (Fri May 01). Automated Checklist Execution.
(powered by Instant-Cquotes)
Cquote2.png

Nasal/Canvas: A simple tiled map

Using the Canvas GUI, you can make a simple tiled map using images downloaded on the fly You can view the code behind the map at Canvas Snippets#A simple tile map.

A simple, canvas based tile map which is centered around the aircraft.

Scenery Corner

Scenery Project Elba

The Scenery Project Elba has been started, aiming to improve the scenery of Elba, an island west of Italy. More information can be found on the wiki page: Scenery Project Elba. Contributions welcome! Development thread: http://forum.flightgear.org/viewtopic.php?f=5&t=26138

Elba.jpg

Community News

The Festival of FlightGear 2015 (1/2) - 2 & 3 May

Time: All weekend Sat 00:00-Sun 23:59 Location: Argentina/Brazil (SBRJ/SBGL and south)

Contributing

Translators required

En.gif The FlightGear Wiki still needs help for translating it into various languages. If you are interested in making the FlightGear Wiki multi-language then start at Help:Translate.
De.gif Das FlightGear Wiki benötigt immer noch Hilfe bei der Übersetzung in verschiedene Sprachen. Wenn Du Interesse daran hast, das FlightGear Wiki Mehrsprachig zu machen, dann fang doch mit Help:Übersetzen an.
Nl.gif De FlightGear Wiki kan nog steed hulp gebruiken bij het vertalen van artikelen. Als je interesse hebt om de wiki meertalig te maken, raden we je aan om een kijkje te nemen bij Help:Vertalen.
Es.gif La wiki de FlightGear todavía necesita ayuda para traducirla a varios lenguajes. Si estás interesado en hacer la FlightGear wiki multilingüe, entonces comienza en Help:Traducir.
Cat.gif La wiki de FlightGear encara necessita ajuda per traduir-la a diverses llengües. Si esteu interessat en fer la wiki de FlightGear multilingüe, llavors comenceu a Help:Traduir.

FlightGear logos

If you want some graphic elements for your FlightGear-related site (such as a hangar or YouTube channel), please feel free to visit FlightGear logos for a repository of logos. And if you have some art skills, please don't hesitate to contribute with your own design creations.

Screenshots

The FlightGear project always needs screenshots, which show features that were added since the last release. These should be of good quality, especially in content and technical image properties. It is therefore recommended to use the best viable filter settings (anti-aliasing, texture sharpening, etc.). More info at Howto:Make nice screenshots.