UPDATE 07/02/2014 : Read the associated comment on this post from Phil at the Ordnance Survey, quite possibly the best response I’ve ever had on this blog, thank you.
UPDATE 07/02/2014 2: Old Maps at end of this post courtesy of ‘Phil Allen’ FSE Manager at the Ordnance Survey, thank you!
Working with real 3D models of London it sometimes makes sense to place this in context on a boundary map, but I’ve run into to something that’s given me pause for thought….
The City of London is an odd and special part of London I think you’ll agree, I’ve always known it’s administrative boundary as being a little odd (something about bridges…) sure enough on the City of London website there is the boundary showing clearing two bridges are covered in its area.
Now being a GIS sort of fellow I want to download this boundary set, so visiting the OS OpenData site, I see that something’s up whilst one bridge is clearly there on the left, London Bridge has been excluded (hence my clever title). What does it all mean? Well I think probably OS Opendata is generalised in some way and this bit got missed… but I don’t really know. Downloading boundary data from the Greater London Authority data site doesn’t fix things either (it is just the data set the OS gives).
So what does this all mean? Well it means that the OS may well be the ‘authoritative geographic data’ set for the UK, but it doesn’t mean everything you get from it is without ‘issues’. Know your data, know its limitations, also did I mention OpenStreetMap seems to get it right? Why am I relying on data from the OS again?
UPDATE 07/02/2014 1: Read the associated comment on this post from Phil at the Ordnance Survey, quite possibly the best response I’ve ever had on this blog, thank you.
UPDATE 07/02/2014 2: Old Maps below courtesy of ‘Phil Allen’ FSE Manager at the Ordnance Survey, thank you!
I’m always looking for new ways to combine data and visualisation techniques. Partly I’m inspired by the likes of the DigitalUrban blog but mostly I’ve always liked mucking about with 3D software and real world data (3D Construction kit for the C64 anyone?).
So here is what you need for what I’m about to do, there’s a lot of different ways of achieving the same thing and at different costs. Inevitably if you have lots of money the steps are more streamlined.
- ArcGIS or QGIS for creating and exporting your GIS data to …
- SketchUp Pro (to export as FBX files) or SketchUp Free (plus the OBJ importer/exporter and AutoDesk FBX convertor)
- CityEngine (no free alternative for this as far as I am aware but there’s educational licensing)
- Unity (I’m using the free version but Pro works as well!)
- Unity Web player (for running around your model in a web browser)
Okay this will be a very quick run down as I’m not going to go into the details. I suggest you familiarise yourself with each piece of software paying attention to the import export functionalities of each.
This guide, as the blog is in general, primarily a notebook of workflows for myself so I don’t have to remember them all!
Recommended reading? Digital Urban and this “Google SketchUp for Game Design: Beginner’s Guide”
- Create City Streets or download from OpenStreetMap
- Edit data in ArcGIS or QGIS (and save as shapefile) or even use SketchUp pro and export as dxf
- Import data (edited in ArcGIS/QGIS or otherwise…) into CityEngine shapefiles/DXF/GDB/OSM/DAE/OBJ *or you can import OSM data directly*
- Generate your city using various ‘assets’, for example, city streets and plots from a GIS or straight from Open Street Map data. Using rules you can create your own building models as well.
- Once complete export your city model to a FBX format, in CityEngine FBX export dialog box I change the Misc Options Global Offset and click the ‘Center‘ button
- You can also create more more models (signs, trees etc) that can be placed in Unity separately. In SketchUp Pro its just a case of exporting as an FBX file, but if you have SketchUp Free use the OBJ exporter and AutoDesks free FBX converter.
- Either you have exported the city model to the correct Asset folder for your Unity project or you can click on the Assets menu in Unity and select Import New Asset
- In Unity select your newly imported model and using the Inspector window change the scale factor to 1 select Generate Colliders and Import Materials choosing the right Material Naming and Material Search options. The click apply and wait while your model is prepared.
- Once complete drag your model from the Project window into the Scene window and position. Now drag from the Standard Assets–>Character Controllers folder drag and drop the ‘First Person Controller’ onto your model.
- Add a light by selecting the menu GameObject–>Create Other –> Directional Light and then position it in over your model in the Scene window. If you can’t find it double click on the Directional Light heading in the Hierarchy window.
- Add a SkyBox (yes with nice fluffy clouds) by selecting the Edit–>Render Settings menu heading and clickin the little circle to the right of the SkyBox Material heading in the Inspector. In the Select Material dialog box type ‘sky’ and a list of the skyboxes will appear. Select one of these.
- To create a standalone playable demo of your model first make sure it all works click the play button, if you fall off your model press the play button again to stop and make sure the First Person Controller is placed above your model and that you selected the create colliders on your imported model in the Inspector window.
- Select File Build Settings, click “Add Current” to build the scene you are working on. Now click on Web Player (or PC and Mac Standalone) and click Build and Run
- Navigate to the folder where the HTML file has been created an double click on it, if you have installed the Unity Web Player your model walkthrough should load up just as if you had pressed play within Unity itself..