Jump to: navigation, search

Howto:Place 3D objects with the UFO

5,140 bytes added, 09:29, 7 September 2019
Spaced the headers back
The [[UFO from the 'White Project''Placing of the UNESCO|UFO]] aircraft is a superb tool for placing a new (or old) 3D object at any arbitrary location in the scenery with just a few clicks of the mouse. Placing objects inside Flightgear in the scenery using is a really easy way to contribute to the UFO'''[[FlightGear]] project. It does not require any programming knowledge, and you can contribute something valuable in just a few minutes.
A very useful tool for This article gives an overview of placing objects within the scenery, created by Melchior Franz, is available with Flightgear 0.9.10 editing and later. It is an addon to saving objects using the [[UFO from the 'White Project' . You can get a list of flying controls and editing commands by pressing the UNESCO{{key press|?}} key while flying the UFO]] aircraft which allows a user to place a new (or old) 3D object at any arbitrary location in the scenery with just a few clicks of the mouse.
=Selecting the ufo= Choosing your object ==The first thing you need is a 3d 3D model file to place in the scenery; let's say we'll use a catii-iii.xml objectThe [[FlightGear Scenery Database]] ([http://scenemodels. You must save it in a path where this UFO feature can find itflightgear. The UFO searches the objects org/]) maintains a huge library of generic models, which will have been included in your FlightGear installation under the Flightgear/data<tt>[[$FG_ROOT]]/Models/ </tt> directory. In this example, we create You can skip to the next section when using a subdirectory called Tabu and save our catii-iii.xml theregeneric model.
=== Consider the file sizes ===If you add many complex models or models with big textures to the scenery it ''will'' increase the memory usage and slow down FlightGear.Here are two lists with shared models and shared model textures sorted by file size:* [[Image:Placing_objects_with_UFO_html_m49fbed81.jpgShared models sorted by file size]]* [[Textures of shared models sorted by file size]]
=== Creating your own models ===
Alternatively, you can create your own models. You should save it in a subdirectory of your [[$FG_ROOT]] folder. Two options seem reasonable, although others are possible as well:
* Shared model, not unique to a single objects (for example a wind turbine): save it in a subdirectory of <tt>[[$FG_ROOT]]/Models/</tt>. That is the standard directory where the UFO will go when you press the space bar {{Key press|Space}}.
* Static model, unique object (like the Eiffel Tower): save it in the respective subdirectory of the Scenery folder, e.g. <tt>[[$FG_ROOT]]/Scenery/Objects/w130n30/w123n37</tt>. To browse objects anywhere on your computer, press {{key press|L}} when using the UFO.
Now start FlightgearWhen creating your own object, and choose UFO as make sure it is the correct size. In [[Blender]], units are meters. Note that you should be careful about using Google Earth, due to restrictions in their license that might prevent submitting your aircraftwork to the FlightGear database. See {{forum link|t=3356|text=here}} and {{forum link|t=3415|text=here}}.
=Placing objects=Once Flightgear has been started, fly with Selecting the UFO to the place you want the model to be positioned==[[File:Placing_objects_with_UFO_html_m49fbed81.jpg|400px]]
Now start FlightGear with the UFO as your aircraft and enable the console, which is needed later on. When launching FlightGear from command line, use <code>--aircraft=ufo --console</code>. In [[Image:Placing_objects_with_UFO_html_5fa8d7b1.jpgFGRun]], the "Show console" option on the last page should be checked.
Let's say we want to position the catii-iii.xml object at the end of a taxiway. We stop == Placing objects ==Once FlightGear has been started, fly with the UFO just above this intersection and press to roughly the space key, a Select Model window will open up where place you want the contents of the Flightgear/data/Models/ directory will be shown. Select your model from this list, then close the window. The selected model path/name will to be display in green text at the bottom left of the FlightGear screenpositioned.
Now you may point Let's say we want to position the mouse on catii-iii.xml object at the scenery ground end of a taxiway. We stop the UFO just above this intersection and left-click again, press the space key. A Select Model window will open up where the contents of the CAT II<tt>[[$FG_ROOT]]/III ground marking model Models/</tt> directory will be positioned thereshown (or press {{key press|Shift}}+{{key press|L}} and you can go to any desired directory). Of courseSelect your preferred model from this list, it does not have then close the correct orientation and it's partly covered by window. The selected model path/name will be displayed in green text at the surrounding terrain, but we can adjust thatbottom left of the FlightGear screen.
To place the object, simply left-click on the position that you want to place it. By default, it is placed completely horizontal and rotated to point north. It will probably not have the correct orientation and it might be partly covered by the surrounding terrain, but we can adjust that. [[File:Placing_objects_with_UFO_html_12ee70a1.jpg|400px]] ===Rotating objects===
Fly closer to the ground with the UFO, so that you can see it better.
Now press TAB {{key press|{{=}}}} (or Ctrl-Iearlier versions than 3.0 uses {{key press|Tab}}), and use the resulting sliders to adjust the latitude/longitude/elevation/heading of the model. NB: "Pitch" and "roll" will not be saved, so using them might be fun, but won't help eventually.
=Exporting See the result=Now that [[UFO from the model is correctly positioned, press 'White Project' of the D key to dump the model position data to the terminal. A few lines will be printed UNESCO]] page for more information on the consoleUFO command keys and exported file locations, providing the necessary orientation data. You will save those coordinates into a scenery objects file or press {{key press|?}} while in the next step. If you don't do that, next time you run Flightgear it will know nothing about the new objectFlightGear.
=== Deleting objects ===There are three different ways to three different situations in which which you want to delete an object:You want to delete the last object that you placed in this session:: Press the [ backspace button].You want to delete an object that you placed in this session, but you have placed one or two models after it:: That means that it is no longer active. Activate it by placing one more model '''on''' the object you want to delete, press the backspace button. Result: The model you want to delete starts blinking, which tells you that it is active.You want to delete an object that is already saved in the corresponding .stg file and you don't know where it is:: You don't know the filename: The model you want to delete is probably a shared model. You find it in the [Imagehttp:Placing_objects_with_UFO_html_m4cf0cbf7// scenery database]. Now you know the model's filename (e.g. []or [ Office26x22.xml]).: You still need to know where you find it. Place any model on that building and press {{key press|D}} to know in which file you find it (see [[#Exporting the result|Exporting the result]] below). If there are several objects of that type and you want to delete only one of them, find the one closest to the coordinates of your model placed on top.: Open the .stg file, delete the whole model entry (see [[#Exporting the result|Exporting the result]] below). Done.
In == Exporting the terminal windowresult ==Now that the model is correctly positioned, you get three sections printed out by press the UFO with very detailed information about what's going {{key press|D}} key to dump the model position data to the terminal. A few lines will be printed on, we need the line at console, providing the endnecessary orientation data.
e000n50/e008n50/3089154[[File:Placing_objects_with_UFO_html_m4cf0cbf7.stg is the secenery object file where this object's coordinates have to be saved. The default place where to find e000n50 directory is inside Flightgear/data/Scenery/Objects/. You just open the 3089154.stg file with any text editor, add the following line and save it the file:jpg]]
The most important lines are the last ones:
# e000n50/e008n50/3089154.stg
OBJECT_SHARED Models/Tabu/catii-iii.xml 8.57928135 50.03667992 105.9972 111.1
The first line identifies the location of the scenery file for the object. The OBJECT_SHARED line indicates the object's name, longitude, latitude, altitude, and orientation. This can be read by FlightGear itself and can be [ submitted] to the FlightGear Scenery Object Database.  You can also save these coordinates into your own scenery file so that your changes will not be lost the next time you start FlightGear. === Saving the changes to your scenery ===In the terminal window, you get three sections printed out by the UFO with very detailed information about what's going on. We need the lines at the end. As noted above, the UFO helpfully exports the name of the scenery file where the object's coordinates have to be saved. In our example: e000n50/e008n50/3089154.stg  The default location for scenery objects is <tt>[[$FG_SCENERY]]/Objects/</tt>. Simply open the referenced .stg file, add the OBJECT_SHARED line to the bottom and save the file. Now you have your object's position saved, and it will appear inside the scenery every time you start FlightgearFlightGear! There is one pitfall here. If TerraSync is enabled, which is the default in latest FlightGear versions, and you modified the stg file in the TerraSync folder, your modifications might be overridden by the syncing process. You might need to add the startup option --disable-terrasync for avoiding this and to keep your modifications. In our example we would open in <tt>[[$FG_SCENERY]]/Objects/e000n50/e008n50/3089154.stg</tt> and add the following line:OBJECT_SHARED Models/Tabu/catii-iii.xml 8.57928135 50.03667992 105.9972 111.1 For a short video demonstrating the .stg method, see the following video:{{#ev:youtube|i2BSUOMyiIg|400|center}} If you are running Windows OS, then please refer to this video:{{#ev:youtube|e93OUEp0YKc|400|center}} === Saving to XML ===Alternatively, if you press the {{key press|E}} key while developing scenery with UFO, FlightGear will generate an XML file with the dump of your current work in an "ufo-model-export.xml" file under [[$FG_HOME]]. === Loading the XML file as part of FlightGear scenery ===You can later reload this XML file with --config= command-line parameter:Example for Linux: fgfs --config=$HOME/.fgfs/Export/ufo-model-export.xml In Windows, this is done using the Advanced dialog, found on the last page of the [[FGRun]] GUI. Click Advanced and, under General, click the double-dot button, browse to the ufo-model-export.xml file and click OK. == Sharing your updates with everyone! ==Please, once you've improved the scenery around your place, consider sharing it with the community. This is done very easily using our [ scenery submission webforms]. More information and help on {{forum link|t=14671|text=the dedicated topic}} on the scenery forum.
=Useful keys=[[Category:Howto]]* Ufo positioning[[Category:Scenery enhancement]]** PgUp ... move forward (accelerate)[[ar:Howto:Place 3D objects with the UFO]]** PgDown ... move forward (decelerate)** b + PgUp ... move backward (accelerate)** b + PgDown ... move backward (decelerate)[[es:Colocar objetos con el UFO]]** [ [fr:Placer des objets 3D avec UFO]] ... decrease/increase maximum speed (This wil help yuo controlling the Ufo that can be too fast sometimes)** Home ... Hover Up (Increase ufo altitude)** End ... Hover down (Decrease ufo altitude)** P ... toggle radar panel* Object management** mouse click ... Add model to scenery** backspace ... remove selected object(s)** Alt + mouse click .. Move selected object(s) to new place** Ctrl + cursor/arrow keys ... move selected object(s) away/nearer/left/right** m ... toggle marker for active (last selected) object** tab ... open/close cursor dialog* Selection** Ctrl + mouse click ... select nearest object** Shift + mouse click ... add new object to selection** Shift + Ctrl + mouse click ... add nearest object to selection* Model** space ... open/close model selection dialog** Ctrl + PgUp/PgDn ... cycle through model list** l ... load model file via file selector* Export data** d ... dump object data to terminal** e ... export object data* flight plan** n export flight plan

Navigation menu