Howto:Place 3D objects with the UFO: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
No edit summary
(Spaced the headers back)
(19 intermediate revisions by 12 users not shown)
Line 1: Line 1:
The [[UFO from the 'White Project' 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.
The [[UFO from the 'White Project' 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 in the scenery is a really easy way to contribute to the [[FlightGear]] project. It does not require any programming knowledge, and you can contribute something valuable in just a few minutes.


Placing objects in the scenery is a really easy way to contribute to the FlightGear project. It doesn't require any programming knowledge, and you can contribute something valuable in 15 minutes.
This article gives an overview of placing, editing and saving objects using the UFO. You can get a list of flying controls and editing commands by pressing the {{key press|?}} key while flying the UFO.
 
Below is an overview of placing, editing, & saving objects using the UFO. You can get a brief overview of the movement and editing commands by pressing ''?'' while flying the UFO.  


== Choosing your object ==
== Choosing your object ==
The first thing you need is a 3d model to place in the scenery. The FlightGear Scenery Database ([http://scenemodels.flightgear.org/ http://scenemodels.flightgear.org/]) maintains a huge library of generic models, which will have been included in your FlightGear installation.
The first thing you need is a 3D model to place in the scenery. The [[FlightGear Scenery Database]] ([http://scenemodels.flightgear.org/ scenemodels.flightgear.org]) maintains a huge library of generic models, which will have been included in your FlightGear installation under the <tt>[[$FG_ROOT]]/Models/</tt> directory. You can skip to the next section when using a generic model.
 
If you have created your own model you should save it in a subdirectory of your FG root folder. Two options seem reasonable, although others are possible as well:
 
a) Save it in the directory Flightgear/data/Models/. That is the standard directory where the UFO will go when you press the Space bar. Let's say you have created a CAT III marker, called catii-iii.xml. In this example, we create a subdirectory Flightgear/data/Models/Tabu/ and save our catii-iii.xml there. The downpoint: The directory Flightgear/data/Models/ is the place where all shared models from the FG Scenery Database are saved and as your universe of own models grows, you might confuse both.  


b) You can also save your own models in an other subdirectory like Flightgear/data/mymodels (or any other name). Or if they are shared models which have only one fixed position, like the KSFO terminal, you can save them in the respective subdirectory of the Scenery folder, e.g. Flightgear/data/Scenery/Objects/w130n30/w123n37/mymodels (or directly in w123n37). To browse objects anywhere on your computer, press ''l'' when using the UFO.
=== 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:
* [[Shared models sorted by file size]]
* [[Textures of shared models sorted by file size]]


If creating your own object, make sure it is the correct size! In Blender, units are meters and the Caliper script may help. Note that you should be careful about using Google Earth, due to restrictions in their license that might prevent submitting your work to the FG database. See [http://flightgear.org/forums/viewtopic.php?f=5&t=3356 here] and [http://flightgear.org/forums/viewtopic.php?f=5&t=3415 here].  (Just using coordinates should be okay, because coordinates of real-world objects are not copyrightable, but be careful of other content.)
=== 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.


== Selecting the ufo ==
When creating your own object, 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 work to the FlightGear database. See {{forum link|t=3356|text=here}} and {{forum link|t=3415|text=here}}.


== Selecting the UFO ==
[[File:Placing_objects_with_UFO_html_m49fbed81.jpg|400px]]
[[File:Placing_objects_with_UFO_html_m49fbed81.jpg|400px]]


Now start Flightgear, and choose UFO as your aircraft.
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 [[FGRun]], the "Show console" option on the last page should be checked.


== Placing objects ==
== Placing objects ==
Once Flightgear has been started, fly with the UFO to the place you want the model to be positioned.
Once FlightGear has been started, fly with the UFO to roughly the place you want the model to be positioned.
 
Note that you should not use Google Earth to determine the correct position due to licensing problems. See [http://flightgear.org/forums/viewtopic.php?f=5&t=3356 here] and [http://flightgear.org/forums/viewtopic.php?f=5&t=3415 here].


[[File:Placing_objects_with_UFO_html_5fa8d7b1.jpg|400px]]
[[File:Placing_objects_with_UFO_html_5fa8d7b1.jpg|400px]]


Let's say we want to position the catii-iii.xml object at the end of a taxiway. We stop the UFO just above this intersection and press the space key, a Select Model window will open up where the contents of the Flightgear/data/Models/ directory will be shown (or press "L" and you can go to any desired directory). Select your model from this list, then close the window. The selected model path/name will be display in green text at the bottom left of the FlightGear screen.
Let's say we want to position the catii-iii.xml object at the end of a taxiway. We stop the UFO just above this intersection and press the space key. A Select Model window will open up where the contents of the <tt>[[$FG_ROOT]]/Models/</tt> directory will be shown (or press {{key press|Shift}}+{{key press|L}} and you can go to any desired directory). Select your preferred model from this list, then close the window. The selected model path/name will be displayed in green text at the bottom left of the FlightGear screen.


[[File:Placing_objects_with_UFO_html_m184fb381.jpg|400px]]
[[File:Placing_objects_with_UFO_html_m184fb381.jpg|400px]]


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 will be partly covered by the surrounding terrain, but we can adjust that.
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]]
[[File:Placing_objects_with_UFO_html_12ee70a1.jpg|400px]]


== Rotating objects ==
=== Rotating objects ===
Fly closer to the ground with the UFO, so that you can see it better.
Fly closer to the ground with the UFO, so that you can see it better.


Now press TAB (or Ctrl-I), 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.
Now press {{key press|{{=}}}} (earlier 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.


[[File:Placing_objects_with_UFO_html_439816e9.jpg|400px]]
[[File:Placing_objects_with_UFO_html_439816e9.jpg|400px]]


See the [[UFO from the 'White Project' of the UNESCO]] page for more information on the UFO command keys and exported file locations, or press ? while in FlightGear.
See the [[UFO from the 'White Project' of the UNESCO]] page for more information on the UFO command keys and exported file locations, or press {{key press|?}} while in FlightGear.


== Deleting objects ==
=== Deleting objects ===
There are three different ways to three different situations in which which you want to delete an object:
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:
You want to delete the last object that you placed in this session:
: Press the [http://en.wikipedia.org/wiki/Backspace backspace button].
: Press the [http://en.wikipedia.org/wiki/Backspace backspace button].
Line 54: Line 53:
: 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.
: 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 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 [http://scenemodels.flightgear.org/ scenery database]. Now you know the model's file name (e.g. [http://scenemodels.flightgear.org/modeledit.php?id=45 generic_skyscraper_01.ac] or [http://scenemodels.flightgear.org/modeledit.php?id=537 Office26x22.xml]).
: You don't know the filename: The model you want to delete is probably a shared model. You find it in the [http://scenemodels.flightgear.org/ scenery database]. Now you know the model's filename (e.g. [http://scenemodels.flightgear.org/modeledit.php?id=45 generic_skyscraper_01.ac] or [http://scenemodels.flightgear.org/modeledit.php?id=537 Office26x22.xml]).
: You still need to know where you find it. Place any model on that building and 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.
: 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.
: Open the .stg file, delete the whole model entry (see [[#Exporting the result|Exporting the result]] below). Done.


== Exporting the result ==
== Exporting the result ==
Now that the model is correctly positioned, press the ''d'' key to dump the model position data to the terminal. A few lines will be printed on the console, providing the necessary orientation data.  
Now that the model is correctly positioned, press the {{key press|D}} key to dump the model position data to the terminal. A few lines will be printed on the console, providing the necessary orientation data.  


[[File:Placing_objects_with_UFO_html_m4cf0cbf7.jpg]]
[[File:Placing_objects_with_UFO_html_m4cf0cbf7.jpg]]


The most important lines are the last ones:
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


# e000n50/e008n50/3089154.stg
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 [http://scenemodels.flightgear.org/contribute.php submitted] to the FlightGear Scenery Object Database.  
OBJECT_SHARED Models/Tabu/catii-iii.xml 8.57928135 50.03667992 105.9972 111.1
 
The first line identified the location of the scenery file for the object. The OBJECT_SHARED line indicates the objects name, longitude, latitude, altitude and orientation. This can be read by FlightGear itself and can be ([http://scenemodels.flightgear.org/contribute.php 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.
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 ==
=== 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.
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
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


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 FlightGear! 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.


The default location for scenery files is Flightgear/data/Scenery/Objects/. 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 Flightgear!
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
In our example we would open 3089154.stg in Flightgear/data/Scenery/Objects/e000n50/e008n50/ 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:
For a short video demonstrating the .stg method, see the following video:
{{#ev:youtube|i2BSUOMyiIg|400|This is an embedded video!}}
{{#ev:youtube|i2BSUOMyiIg|400|center}}
 
== Saving to XML ==
 
Alternatively, if you press the ''e'' key while developing scenery with Ufo, fgfs will generate an xml file with the dump of your current work in a "ufo-model-export.xml" file.
 
Under Unix, the file is saved to directory ''~/.fgfs''
 
Under Windows it is saved to ''%APPDATA%\flightgear.org''. Under a typical Windows installation the file will look something like this:


  C:\Documents and Settings\{YOURUSERNAME}\Application Data\flightgear.org
If you are running Windows OS, then please refer to this video:
{{#ev:youtube|e93OUEp0YKc|400|center}}


(Note that some FlightGear 1.9.1 users have reported that pressing ''e'' gives an error message to the console and fails to save the XML file. The [http://www.flightgear.org/forums/viewtopic.php?f=2&t=3170&st=0&sk=t&sd=a&sid=a14a7a3a2f2084f44295880fca7e2932 problem is outlined here] and [http://www.flightgear.org/forums/viewtopic.php?f=2&t=3170&st=0&sk=t&sd=a&start=15 solution given here]--simply add a line to ~flightgear~/data/Nasal/IORules reading "WRITE ALLOW $FG_HOME/ufo-model-export.xml".)
=== 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 ==
=== Loading the XML file as part of FlightGear scenery ===
You can later reload this XML file with --config= command-line parameter:
You can later reload this XML file with --config= command-line parameter:
Example for Linux: fgfs --config=$HOME/.fgfs/Export/ufo-model-export.xml


Example for Linux:
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.
fgfs --config=$HOME/.fgfs/ufo-model-export.xml


In Windows, this is done using the Advanced dialog, found on the last panel of the FG Run 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 [http://scenemodels.flightgear.org/submission scenery submission webforms]. More information and help on {{forum link|t=14671|text=the dedicated topic}} on the scenery forum.


[[Category:Howto|Place 3D objects with the UFO]]
[[Category:Howto]]
[[Category:Scenery enhancement|Place 3D objects with the UFO]]
[[Category:Scenery enhancement]]
[[ar:Howto:Place 3D objects with the UFO]]
[[es:Colocar objetos con el UFO]]
[[fr:Placer des objets 3D avec UFO]]
[[fr:Placer des objets 3D avec UFO]]

Revision as of 09:29, 7 September 2019

The 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 in the scenery is a really easy way to contribute to the FlightGear project. It does not require any programming knowledge, and you can contribute something valuable in just a few minutes.

This article gives an overview of placing, editing and saving objects using the UFO. You can get a list of flying controls and editing commands by pressing the ? key while flying the UFO.

Choosing your object

The first thing you need is a 3D model to place in the scenery. The FlightGear Scenery Database (scenemodels.flightgear.org) maintains a huge library of generic models, which will have been included in your FlightGear installation under the $FG_ROOT/Models/ directory. You can skip to the next section when using a generic 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:

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 $FG_ROOT/Models/. That is the standard directory where the UFO will go when you press the space bar Space.
  • Static model, unique object (like the Eiffel Tower): save it in the respective subdirectory of the Scenery folder, e.g. $FG_ROOT/Scenery/Objects/w130n30/w123n37. To browse objects anywhere on your computer, press L when using the UFO.

When creating your own object, 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 work to the FlightGear database. See here This is a link to the FlightGear forum. and here This is a link to the FlightGear forum..

Selecting the UFO

Placing objects with UFO html m49fbed81.jpg

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 --aircraft=ufo --console. In FGRun, the "Show console" option on the last page should be checked.

Placing objects

Once FlightGear has been started, fly with the UFO to roughly the place you want the model to be positioned.

Placing objects with UFO html 5fa8d7b1.jpg

Let's say we want to position the catii-iii.xml object at the end of a taxiway. We stop the UFO just above this intersection and press the space key. A Select Model window will open up where the contents of the $FG_ROOT/Models/ directory will be shown (or press Shift+L and you can go to any desired directory). Select your preferred model from this list, then close the window. The selected model path/name will be displayed in green text at the bottom left of the FlightGear screen.

Placing objects with UFO html m184fb381.jpg

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.

Placing objects with UFO html 12ee70a1.jpg

Rotating objects

Fly closer to the ground with the UFO, so that you can see it better.

Now press = (earlier versions than 3.0 uses 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.

Placing objects with UFO html 439816e9.jpg

See the UFO from the 'White Project' of the UNESCO page for more information on the UFO command keys and exported file locations, or press ? while in FlightGear.

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 scenery database. Now you know the model's filename (e.g. generic_skyscraper_01.ac or Office26x22.xml).
You still need to know where you find it. Place any model on that building and press D to know in which file you find it (see 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 below). Done.

Exporting the result

Now that the model is correctly positioned, press the D key to dump the model position data to the terminal. A few lines will be printed on the console, providing the necessary orientation data.

Placing objects with UFO html m4cf0cbf7.jpg

The most important lines are the last ones:

  1. 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 $FG_SCENERY/Objects/. 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 FlightGear! 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 $FG_SCENERY/Objects/e000n50/e008n50/3089154.stg 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:

If you are running Windows OS, then please refer to this video:

Saving to XML

Alternatively, if you press the 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 the dedicated topic This is a link to the FlightGear forum. on the scenery forum.