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

m
Robot: Cosmetic changes
m (Embed video)
m (Robot: Cosmetic changes)
Line 3: Line 3:
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.
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.


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.  
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/ http://scenemodels.flightgear.org/]) maintains a huge library of generic models, which will have been included in your FlightGear installation.


Line 16: Line 16:
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 not use Google Earth to determine the correct size. See [http://flightgear.org/forums/viewtopic.php?f=5&t=3356 here] and [http://flightgear.org/forums/viewtopic.php?f=5&t=3415 here].
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 not use Google Earth to determine the correct size. See [http://flightgear.org/forums/viewtopic.php?f=5&t=3356 here] and [http://flightgear.org/forums/viewtopic.php?f=5&t=3415 here].


==Selecting the ufo==
== Selecting the ufo ==


[[Image: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, and choose UFO as your aircraft.


==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 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].
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].


[[Image: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 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.


[[Image: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 will be partly covered by the surrounding terrain, but we can adjust that.


[[Image: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 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.


[[Image: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 ? 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:


Line 58: Line 58:
: 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 ''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.  


[[Image: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:
Line 68: Line 68:
  OBJECT_SHARED Models/Tabu/catii-iii.xml 8.57928135 50.03667992 105.9972 111.1
  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.  
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.
Line 89: Line 89:
{{#ev:youtube|i2BSUOMyiIg|400|This is an embedded video!}}
{{#ev:youtube|i2BSUOMyiIg|400|This is an embedded video!}}


==Saving to XML==
== 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.  
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.  
Line 95: Line 95:
Under Unix, the file is saved to directory ''~/.fgfs''  
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:
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
   C:\Documents and Settings\{YOURUSERNAME}\Application Data\flightgear.org


(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".)
(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".)


==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:


Line 108: Line 108:


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


[[Category:Howto|Place 3D objects with the UFO]]
[[Category:Howto|Place 3D objects with the UFO]]
[[Category:Scenery enhancement|Place 3D objects with the UFO]]
[[Category:Scenery enhancement|Place 3D objects with the UFO]]