Durk has suggested that I repeat some of my screenshot tips,
as we need stunning new screenshots for the flightgear.org
website. (What I write isn't binding, as I don't do this in
any official function.)

(1) contents: Obviously, screenshots should focus on new
    features/scenery/aircraft. Those should be generally
    available, ideally from our repository, but at least
    freely downloadable on the net under GPL compatible
    license terms. Please no aircraft etc. that are proprietary
    or unreleased.

(2) quality:
    - use highest feasible filter settings (antialiasing, etc)
    - hide frame rater counter, menu, dialogs (unless they
      are part of what you want to demonstrate)
    - use realistic scenarios: no 747 approach to the Nimitz etc.
    - avoid the display of fgfs shortcomings: no rain in cockpits,
      no cloud artifacts, no floating aircraft, no transparency
      problems. (Yes, that's cheating. But people know that any
      software (apart from TeX :-) has bugs, and demonstrating
      bugs is not the purpose of our screenshots.)
    - please understand that, in case there are *many* submissions,
      Curt has to choose the better ones. (Unfortunately, that's
      not usually one of our main problems.  ;-)

(3) legal matters: though there's no official decision yet about
    which license the screenshots should be under, the outcome
    of a recent discussion implies that the rules set out under
    http://wiki.flightgear.org/index.php/Submitting_Screenshots
    should be valid. (A review by the FSFE -- the Free Software
    Foundation Europe is still pending.)

    No exceptions, please! Distribute your screenshots *yourself*
    under whichever license you want, but accept that FlightGear
    distributes them under these terms. Otherwise don't submit
    any. (Unless Curt decides otherwise, of course.)

(4) tools: Some older systems don't run well with high-quality
    filter settings. People with such systems can use the attached
    script to work around that:

    - save it to ~/.fgfs/Nasal/   (create this dir if necessary)
    - create a directory ~/.fgfs/Export/
    - run fgfs "normally", find good motive, pause, press Ctrl-q
      to save an XML snapshot of the situation
    - re-run flightgear with that situation and with antialiasing
      etc. turned on:

        $ fgfs --aircraft=ufo ~/.fgfs/Export/snapshot-KSFO-bo105-1.xml

    - find perfect sun angle, weather, perspective, then make
      the screenshot with F3

m.
# Utility that writes XML snapshots of current aircraft 
position/orientation/state,
# which can then be reloaded for taking high-quality screenshots using the UFO
# as viewer, and with aliasing at maximum values. This is useful for systems 
with
# slower graphics hardware, where highest filter settings lower the frame rate 
too
# much to take good screenshots.
#
# (1) make sure ~/.fgfs/Export/ directory exists
# (2) run fgfs and make snapshots with Ctrl-q
# (3) reload snapshots to make screenshots:
#     $ fgfs --aircraft=ufo ~/.fgfs/Export/snapshot-KSFO-bo105-1.xml


settimer(func {
        setlistener("/devices/status/keyboard/event", func(event) {
                var e = event.getValues();
                if (e.pressed and e.modifier.ctrl and e.key == 17)
                        dump_aircraft_snapshot();
        });
}, 0);


# returns unique filename matching a sprintf pattern containing one %d
#
var uniquefilename = func(format) {
        for (var i = 1; i; i += 1) {
                var name = sprintf(format, i);
                if (io.stat(name) == nil)
                        return name;
        }
}


var dump_aircraft_snapshot = func {
        var ac = getprop("/sim/aircraft");
        var apt = airportinfo().id;
        var path = getprop("/sim/fg-home") ~ "/Export/";
        var filename = uniquefilename(path ~ "snapshot-" ~ apt ~ "-" ~ ac ~ 
"-%d.xml");
        var data = props.Node.new();
        var lat = getprop("/position/latitude-deg");
        var lon = getprop("/position/longitude-deg");
        var alt = getprop("/position/altitude-ft");

        var m = data.getNode("sim/presets", 1);
        m.getNode("latitude-deg", 1).setDoubleValue(lat);
        m.getNode("longitude-deg", 1).setDoubleValue(lon);
        m.getNode("altitude-ft", 1).setDoubleValue(alt);

        var m = data.getNode("position", 1);
        m.getNode("latitude-deg", 1).setDoubleValue(lat);
        m.getNode("longitude-deg", 1).setDoubleValue(lon);
        m.getNode("altitude-ft", 1).setDoubleValue(alt);

        var m = data.getNode("models/model", 1);
        m.getNode("path", 1).setValue(getprop("/sim/model/path"));
        m.getNode("latitude-deg", 1).setDoubleValue(lat);
        m.getNode("longitude-deg", 1).setDoubleValue(lon);
        m.getNode("elevation-ft", 1).setDoubleValue(alt);
        m.getNode("heading-deg", 
1).setDoubleValue(getprop("/orientation/heading-deg"));
        m.getNode("pitch-deg", 
1).setDoubleValue(getprop("/orientation/pitch-deg"));
        m.getNode("roll-deg", 
1).setDoubleValue(getprop("/orientation/roll-deg"));

        var g = props.globals;
        props.copy(g.getNode("sim/model", 1), data.getNode("sim/model", 1));
        props.copy(g.getNode("surface-positions", 1), 
data.getNode("surface-positions", 1));
        props.copy(g.getNode("controls", 1), data.getNode("controls", 1));
        props.copy(g.getNode("engines", 1), data.getNode("engines", 1));
        props.copy(g.getNode("rotors", 1), data.getNode("rotors", 1));
        props.copy(g.getNode("gear", 1), data.getNode("gear", 1));

        data.getNode("sim/model").removeChild("path", 0);
        io.write_properties(filename, data);
        print("snapshot written to ", filename);
        gui.popupTip("snapshot written to " ~ filename, 4);
}


------------------------------------------------------------------------------
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to