Make use of real world data

Make use of real world data

Postby heyda » 08 Jan 2013, 18:43

Hi, as I'm active at the OpenStreetMap project, I'd like to ask if somebody might help me with importing real world data? It's basically just an proof of concept (nothing final), but I use the OSM2World framework to convert OSM data to .OBJ and import them to blender. But I'm not very good at blender and don't know if I could add all STK specific changes just on my own and if I could deal with all problems (scale, performance ....).

It's just an try to see if it's general possible (so the player car should drive along the roads, no AE stuff, keeping things simple) so I could include the experiences in a talk about 3D and OSM (of course will mention your community as well) and to show a proof of what is possible with the teamplay of opensource and open data :)

Here my current testbed, a small part of the city of Rostock (Germany), converted with the current OSM2World version:
http://ikaria.informatik.uni-rostock.de ... .blend.zip (ODBL licensed)
Attachments
first.jpg
heyda
 
Posts: 46
Joined: 02 Jan 2013, 11:18

Re: Make use of real world data

Postby ctdabomb » 08 Jan 2013, 19:14

so you want to make tracks based on the real world? It sounds cool(I tried this once before with OpenStreetMap but I couldn't for some reason), but the poly count might get too high, the building might not be detailed enough(or too detailed) etc.....
but I really like the idea and think it should be perused more.
Some people are like slinkies... not really good for anything, but you still can't help smiling when you shove them down the stairs.
ctdabomb
SuperTux Moderator
 
Posts: 1075
Joined: 13 Dec 2011, 21:21
Location: halfway there

Re: Make use of real world data

Postby WillemS » 08 Jan 2013, 19:25

heyda {l Wrote}:Hi, as I'm active at the OpenStreetMap project, I'd like to ask if somebody might help me with importing real world data? It's basically just an proof of concept (nothing final), but I use the OSM2World framework to convert OSM data to .OBJ and import them to blender. But I'm not very good at blender and don't know if I could add all STK specific changes just on my own and if I could deal with all problems (scale, performance ....).

It's just an try to see if it's general possible (so the player car should drive along the roads, no AE stuff, keeping things simple) so I could include the experiences in a talk about 3D and OSM (of course will mention your community as well) and to show a proof of what is possible with the teamplay of opensource and open data :)

Here my current testbed, a small part of the city of Rostock (Germany), converted with the current OSM2World version:
http://ikaria.informatik.uni-rostock.de ... .blend.zip (ODBL licensed)


Well, as an OSM addict I of course also played with OSM2World :D I once tried importing some data into Blender to render it with the Cycles render engine, which went pretty well.

It would be a nice idea to try importing these models in SuperTuxKart as tracks, but OSM2World has to get a little bit more mature for that to be really useful, I think. The first thing you would have to do is texturing the models (SuperTuxKart doesn't support plain colours as materials, as far as I know, you have to assign all faces a texture). It would probably be possible to do that a bit automated. However I remember reading somewhere that the developer of OSM2World wanted to add support for texturing in the future.

I think if you get so far (i.e. a model that looks okay in STK) it would be relatively easy to make a real track out of it. One would have to add drivelines that define the shape of the track, that shouldn't be too difficult. Of course to make the track fun one would have to add barriers etc. manually, but for a concept that wouldn't be needed.
Last edited by WillemS on 08 Jan 2013, 20:02, edited 1 time in total.
WillemS
 
Posts: 79
Joined: 03 Nov 2012, 17:42

Re: Make use of real world data

Postby WillemS » 08 Jan 2013, 19:47

I just tried exporting some data from Blender to STK and it worked :) (For fun I first generated my own Blender file with OSM2World.)

I had to add a driveline (else STK crashed apparently), but it seems that the scale is just right automatically.

As I said, the colours aren't visible in-game. Also the polygon count is rather high, but that would be avoidable by 'cropping' the Blender file before exporting (the exported area is much too large now).

This process won't make tracks of high quality, but it is just funny to be able to race in your own neighbourhood ;)
Attachments
osm2stk.jpg
OSM in SuperTuxKart
WillemS
 
Posts: 79
Joined: 03 Nov 2012, 17:42

Re: Make use of real world data

Postby heyda » 08 Jan 2013, 22:16

Hi, thank you all for your feedback :)

WillemS {l Wrote}:Well, as an OSM addict I of course also played with OSM2World :D I once tried importing some data into Blender to render it with the Cycles render engine, which went pretty well.

I currently working on getting it some animations and renders, but my blender skills are very outdated and basic ;)

WillemS {l Wrote}:It would be a nice idea to try importing these models in SuperTuxKart as tracks, but OSM2World has to get a little bit more mature for that to be really useful, I think. The first thing you would have to do is texturing the models (SuperTuxKart doesn't support plain colours as materials, as far as I know, you have to assign all faces a texture). It would probably be possible to do that a bit automated. However I remember reading somewhere that the developer of OSM2World wanted to add support for texturing in the future.

Not sure about this texturing support, but currently it doesn't display nor save textures. I will ask user:Tordanik about what is missing. But B/W is ok to me currently, as it shows THAT it is working ;)
Maybe we can write a python script, that analyses the current material name and assigns a texture with the same single colour to the mesh parts again?

WillemS {l Wrote}:I just tried exporting some data from Blender to STK and it worked :) (For fun I first generated my own Blender file with OSM2World.)

I had to add a driveline (else STK crashed apparently), but it seems that the scale is just right automatically.

As I said, the colours aren't visible in-game. Also the polygon count is rather high, but that would be avoidable by 'cropping' the Blender file before exporting (the exported area is much too large now).

This process won't make tracks of high quality, but it is just funny to be able to race in your own neighbourhood ;)


You can limt the polygons by using OSM2Worlds "export OBJ directory" feature. So you can pick out only the OBJs that contain roads and the one with buildings (for example).
heyda
 
Posts: 46
Joined: 02 Jan 2013, 11:18

Re: Make use of real world data

Postby Funto » 09 Jan 2013, 04:53

It may be easier for the script to assign vertex colors instead of adding textures, and STK supports vertex colors.
Funto
 
Posts: 459
Joined: 09 Dec 2009, 13:47
Location: Bordeaux, France

Re: Make use of real world data

Postby antoine » 09 Jan 2013, 05:28

@WillemS and heyda

If you get it working better, you should do a blog post for OSM
antoine
 
Posts: 108
Joined: 01 Jan 2013, 13:37

Re: Make use of real world data

Postby heyda » 09 Jan 2013, 09:32

Yes, but before promoting it, we need to make sure, that the results are, what the user expects (here: have at least the same scenario to drive around, what the user sees in OSM2World).
Beside that, we have to make sure, that players don't missunderstand OSM as game editor and change the existing map on their fantasies ;)

Maybe the script can replace objects as well (e.g. trees with the 2 crossed STK trees, ...).
heyda
 
Posts: 46
Joined: 02 Jan 2013, 11:18

Re: Make use of real world data

Postby WillemS » 09 Jan 2013, 10:39

My Python skills are pretty much non-existent I fear, so I think I can't be of much help there...

heyda {l Wrote}:Maybe the script can replace objects as well (e.g. trees with the 2 crossed STK trees, ...).


If we want to do such things perhaps it would be better to change it in OSM2World directly. If you look at the website (e.g. http://osm2world.org/examples/0.2.0/Low-grade%20Forest%20Track.png) it seems that you can use other tree models. Those shown in the screenshot are too detailed, but we could insert STK trees here perhaps.
WillemS
 
Posts: 79
Joined: 03 Nov 2012, 17:42

Re: Make use of real world data

Postby heyda » 09 Jan 2013, 11:50

Well yes, OSM2World has an simple povray object lib (should be extended with an COLLADA based web service to share generic 3D models, which should become my task). But as it is an generic framework (as World suggests) I don't think that we will find represantations, that everybody would agree, to be simple or detailed for various tasks. Just to stay on the games context, an shooter needs much more detailed geometries, than an racing or flight simulator game.
Anyway, I will ask Tordanik about what he thinks to help us on this step :)
heyda
 
Posts: 46
Joined: 02 Jan 2013, 11:18

Re: Make use of real world data

Postby heyda » 12 Jan 2013, 23:28

I was in contact with Tordanik (the author) and he pointed out how to start up OSM2World with Texture support:
1. Download the texture pack from http://osm2world.org/download/ and unpack it in your O2W directory
2. Open console and invoke via java -Xmx2G -jar OSM2World.jar --config texture_config.properties --gui

It should export the textures with OBJ (I didn't tested it yet)
Attachments
O2W Textures.png
heyda
 
Posts: 46
Joined: 02 Jan 2013, 11:18

Re: Make use of real world data

Postby WillemS » 13 Jan 2013, 15:09

It works, the textures are now indeed exported to Blender. :)

Make sure that, before importing the OBJ file into Blender, the texture files are copied to the same folder as the OBJ, else Blender will not import the texture names correctly. Then you can export the track normally (after having added a driveline). Finally, before playing, you need to copy the texture files to the same folder as where you exported the track to.

The trees are non-transparent in STK, they are surrounded by a black square. That is caused by the Compositing type being wrong, which could be corrected manually.

Finally all buildings are white. I think the reason for that is that OSM2World renders the building colours by setting a colour "over the texture", which Blender and STK don't understand.
Attachments
osm3stk2.jpg
OSM to STK, now with textures
WillemS
 
Posts: 79
Joined: 03 Nov 2012, 17:42

Re: Make use of real world data

Postby antoine » 15 Jan 2013, 09:25

Cool work guys.
antoine
 
Posts: 108
Joined: 01 Jan 2013, 13:37

Who is online

Users browsing this forum: No registered users and 1 guest