Board index FlightGear Development Scenery

Random Buildings

Questions and discussion about enhancing and populating the FlightGear world.

Re: Random Buildings

Postby stuart » Fri Apr 20, 2012 7:34 pm

Torsten has rather hit the nail on the head:

it would be somewhat far-fetched to ask Stuart to make a faster Nasal interface than the existing one just because someone might eventually work on it.


Yes, it would be possible but it probably represents 10 hours of speculative development that I don't have time for right now. Given that people don't seem to making significant use of the tools already available by modifying materials.xml (at least not in a way that is making itself as far as git), I just don't see sufficient interest. That may change once these changes are available, as it'll give people a lot more scope for creating cities.

-Stuart
G-MWLX
User avatar
stuart
Moderator
 
Posts: 1469
Joined: Wed Nov 29, 2006 9:56 am
Location: Edinburgh
Callsign: G-MWLX

Re: Random Buildings

Postby Hooray » Fri Apr 20, 2012 7:43 pm

Like I said before, I do understand and even agree with the points Thorsten made - and once your code is committed, it will be possible to tell how easy it really is to make it accessible to scripting space using one of the 3 methods discussed.

Stuart wrote:Given that people don't seem to making significant use of the tools already available by modifying materials.xml (at least not in a way that is making itself as far as git), I just don't see sufficient interest.


I see, but I am not sure if this statement should be made with a focus on materials.xml (obviously your preferred route of customizing things): Actually, we've seen a number of related developments - such as IntelQube's "Instant City" addon, or the more recent effort by Rickbritto. So people are clearly interested in this.
Like Thorsten also rightly pointed out, people are pulling into different directions, which are unfortunately somewhat conflicting. But overall, it's pretty obvious that people are interested in extending the scenery and populating it with buildings in particular.

Given that you have developed the code in question, and given that materials.xml is your preferred option for customizing things, my impression is that we should work on better documenting things, so that people can learn how to customize the simulator using materials.xml - I haven't checked, but I am not aware of any dedicated tutorials discussing this? If there IS documentation available, it should probably be reviewed, improved and made more prominent.

So I am really not sure if we should even try to see a trend here: Modifying an XML file is obviously simpler than scripting, so it would certainly even be the option preferred by non-developers (i.e. modelers) - and if they don't know how to make use of these possibilities, we should clearly work on better documenting the process that's involved here.

From a coder's perspective, the things that Thorsten mentioned (advanced and procedural model creation and placement) would still be interesting. Obviously that's much more advanced than what most 3D modelers will want to do though admittedly.

Like I said before: The good thing is, adding a Nasal interface to make existing C++ code accessible is fairly trivial and much simpler than writing the original backend code. And this is clearly not a task that needs to be done by the developer of the original C++ code, as can be seen by all the existing Nasal extension functions, most of which were added by people who didn't really write the corresponding backend code.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11376
Joined: Tue Mar 25, 2008 8:40 am

Re: Random Buildings

Postby stuart » Tue Apr 24, 2012 9:22 pm

This is now checked in, so please have a look.

It's also extensively documented, along with the rest of materials.xml in data/Docs/README.materials. I've even produced a key to help creating new textures :)

Enjoy!

-Stuart
G-MWLX
User avatar
stuart
Moderator
 
Posts: 1469
Joined: Wed Nov 29, 2006 9:56 am
Location: Edinburgh
Callsign: G-MWLX

Re: Random Buildings

Postby Chouchou2570 » Fri May 04, 2012 9:24 am

Hello Guys,

Random buildings look promising. We have a talented dev who coded a nice application for X-plane which allow us to import directly OSM building data into X-Plane as a scenery. It perfectly fits road net and photo scenery while available.
You can check his work here : http://www.osm2xp.com/

Maybe you can contact him to know what is possible to do.

Kindly
Olivier
Last edited by Gijs on Fri May 04, 2012 9:30 am, edited 1 time in total.
Reason: remove spam
User avatar
Chouchou2570
 
Posts: 14
Joined: Fri Jun 19, 2009 9:35 am

Re: Random Buildings

Postby Gijs » Fri May 04, 2012 9:28 am

Hi Olivier,

Those are not so random any more ;-) But yes, it can be done in FlightGear, see http://wiki.flightgear.org/OpenStreetMap_buildings
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9384
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Random Buildings

Postby Hooray » Fri May 04, 2012 10:03 am

Chouchou2570 wrote in Fri May 04, 2012 9:24 am:Hello Guys,

Random buildings look promising. We have a talented dev who coded a nice application for X-plane which allow us to import directly OSM building data into X-Plane as a scenery. It perfectly fits road net and photo scenery while available.
You can check his work here : http://www.osm2xp.com/

Maybe you can contact him to know what is possible to do.


This would require some form of interface, so that stuart's random buildings can be aligned using networks of roads, rivers, railway tracks - like Gijs said, the randomness would be gone then ...
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11376
Joined: Tue Mar 25, 2008 8:40 am

Re: Random Buildings

Postby Chouchou2570 » Fri May 04, 2012 10:28 am

Ok, I was not aware that it already exist for FG. So next question, can't it be add to stock FG scenery with Terragear, to ehance realism and avoid -not so random- building :wink:

Speaking of X-Plane, Austin, our "gourou" only awnt to hear about autogen which is supposed to be the best answer for a global simulator. But with OSM road, river and now building, X-Plane has never been so realist as now. Add some photo scenery and you have the graal.

Bennyboy, the dev of osm2xp offer this tool but also a repository of scenery pack already done : http://scenery.osm2xp.com/ and updated on a regular basis. This way, if you want to have your house in XP or FG, you only need to add it in OSM, and everyone, including OSm user will benefit of this add.

Kindly
Olivier
User avatar
Chouchou2570
 
Posts: 14
Joined: Fri Jun 19, 2009 9:35 am

Re: Random Buildings

Postby Gijs » Fri May 04, 2012 10:36 am

Could you please stop spamming our forum with your aircraft website? You may add the link in your profile, but there's no need to place it in all your posts. Thanks!

can't it be add to stock FG scenery

It cannot, because OpenSceneryX and OpenStreetMap data are Creative Commons, while FlightGear (scenery) is GNU GPL. OpenStreetMap is changing license at the moment, after which it will be compatible with GNU GPL (so right now it is not yet possible to include any OSM data in the official scenery).

Besides that, FlightGear has a different way of placing objects than X-Plane. So you'd need to do convert it (if possible) to get it in FlightGear.
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9384
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Random Buildings

Postby Chouchou2570 » Fri May 04, 2012 10:58 am

Ok, I understand

Olivier

P.S: My intention was not to spam, sorry.
User avatar
Chouchou2570
 
Posts: 14
Joined: Fri Jun 19, 2009 9:35 am

Re: Random Buildings

Postby Hooray » Fri May 04, 2012 11:08 am

Chouchou2570 wrote in Fri May 04, 2012 10:28 am:Speaking of X-Plane, Austin, our "gourou" only awnt to hear about autogen which is supposed to be the best answer for a global simulator. But with OSM road, river and now building, X-Plane has never been so realist as now. Add some photo scenery and you have the graal.


Actually, using OSM data isn't really conflicting with "autogen" at all - it just requires the built-in autogen component to expose an interface, so that the placement heuristics can be affected according to the OSM vector data.

After looking at the website, I do understand that the approach taken by OSM2XP is a little different, in that it creates the buildings externally and then provides precompiled scenery for use by XP (?) - obviously, that is because OSM2XP is an external tool, written in Java.

That's actually similar to how FlightGear uses precompiled scenery which is created using TerraGear. XPlane on the other hand, creates airports, runways and taxiways procedurally at runtime.

We previously talked about exposing the placement heuristics, so that a Nasal script could affect the placement algorithm in some way - once that is supported, a Nasal script could place buildings while honouring OSM vector data.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11376
Joined: Tue Mar 25, 2008 8:40 am

Re: Random Buildings

Postby benny » Mon May 07, 2012 4:56 pm

Hello,

I'm Ben , dev of osm2xp.
In its latest versions, osm2xp is now aimed at being an open street map transformer rather than just a xplane scenery generator.
It's layered in a way that you can add a new output with minimal coding, so if anyone want to work with me on a flight gear mode, fell free to contact me.


It will also be openSource asap, i just have to refactor/clean code before.

Cheers

Ben
benny
 
Posts: 3
Joined: Mon May 07, 2012 4:47 pm

Re: Random Buildings

Postby Hooray » Mon May 07, 2012 6:27 pm

Hi & welcome,

thanks for joining us here!

It is great that you are going to make your source code available !
FlightGear is however written in C++, and your tool apparently in Java, right?
Also, FlightGear uses OSG (OpenSceneGraph) to create those buildings at runtime, while your tool seems to create the models in a pre-compiled fashion, right?

However, Java and C++ are similar enough, so maybe some of your OSM2XP ideas or snippets could be useful in FlightGear, too.

You can see for yourself:

FlightGear's random building code is implemented as part of the SimGear library, in the tgdb folder: http://gitorious.org/fg/simgear/trees/n ... scene/tgdb
The most important file is SGBuildingBin.cxx: http://gitorious.org/fg/simgear/blobs/n ... ingBin.cxx

Obviously, modifying these files makes only sense if you are able to build FlightGear from source: http://wiki.flightgear.org/Building_Flightgear
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11376
Joined: Tue Mar 25, 2008 8:40 am

Re: Random Buildings

Postby benny » Mon May 07, 2012 7:59 pm

Yes osm2xp is written in Java.

Looking at that page : http://wiki.flightgear.org/Howto:Place_ ... th_the_UFO

I think my tool could do something with flight gear using this kind of process.

To sum how osm2xp is working:

-read osm data
-find a osm object (forest, building, lighthouse, whatever)
-Use a Translator object to transform data to choosen output
-Rinse & repeat

-> and at the end you got a file for your choosen output.


So an exemple for flightGear would be

-Read osm data of some country
-The parser found a osm object, and send it to the FlightGearTranslator object
-The flight gear translator see that this osm object is a building, 40 meters wide, 7 floors
- The translator choose the best suited object for this osm building, using "osm2xp rules" (rules are the combination of a open street map tag, 1-n 3D objects , and some assertions )
Ok so let's say the translator choose this object for this osm building : http://scenemodels.flightgear.org/modeledit.php?id=327
-The translator put the reference to this object at the osm object location in the scenery file (xml , txt, whatever the sim want)

Rinse and repeat till the end of the country

-> you got your scenery file.

Here's an exemple of the gui where you create the rules for xplane , as you can see the goal is to attach a open street map tag to a 3D object(s) and add some logic on top of it :
Image
benny
 
Posts: 3
Joined: Mon May 07, 2012 4:47 pm

Re: Random Buildings

Postby hvengel » Mon May 07, 2012 10:32 pm

Gijs wrote in Fri May 04, 2012 10:36 am:
can't it be add to stock FG scenery

It cannot, because OpenSceneryX and OpenStreetMap data are Creative Commons, while FlightGear (scenery) is GNU GPL. OpenStreetMap is changing license at the moment, after which it will be compatible with GNU GPL (so right now it is not yet possible to include any OSM data in the official scenery).


Seems I have been reading this same thing for several years now but maybe it has not been that long. Does anyone have any idea when OSM will actually have the GPL compatible license in place?
hvengel
Retired
 
Posts: 1128
Joined: Sun Dec 24, 2006 4:35 am
Location: Minden Nevada

Re: Random Buildings

Postby Gijs » Mon May 07, 2012 10:40 pm

http://blog.osmfoundation.org/2012/04/2 ... l-ongoing/, still waiting for that "another update next week" though. :)
But they're further then ever, and hey, just imagine how hard it would be if we were to relicense FlightGear. OSM has many more contributors!
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9384
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

PreviousNext

Return to Scenery

Who is online

Users browsing this forum: No registered users and 2 guests