Mar 24, 2013

Open Street Map’s Extend3D


Hello everyone! Several month ago we began a new project. The essence of the project is to create a web application of OSM 3D viewer and editor. So I'm going to tell you a few words about main directions of project, that we've been working on over the last months.

OSM data processing

First of all, we decided to create a script for OSM data processing. This script will parse OSM file, then it will select buildings, remove excess points, analyze a form of each building and try to recreate it using simple 3D objects. After all the received information will be added in the DB.

Visualization of three-dimensional landscape using OSM data

The task consists of developing a set of methods for visualization of 3D landscape allowing to display real-time area, that is scalable in size in various levels of detail for displayed surface. Effective implementation of these methods allows using of modern computers to conventional graphics cards.
The first step is generation of landscape tops using map of heights. It is necessary to break landscape on tiles (grid of three-dimensional nodes) and build a quad-tree which represents the LOD (level of detail) from them.

Schematic representation of the quad-tree:

   
The next step is texturing each tile corresponding OSM texture and setting the algorithm for selecting the desired detail.


 

3D object editor

Also we are developing 3D object editor using the Three-JS library. Possibility of rotation, scaling and movement of objects is implemented. The addition of such primitives as sphere, cube and cylinder is implemented too.



We can fill the landscape with buildings using these primitives, as well as custom objects. Soon we will add physics and improve usability.

Geometry Builder

User can create new difficult object from primitives using geometry editor, which will be built on the basis of object editor.
We will develop geometry builder using the constructive solid geometry library with the help of cgs-functions such as union, intersection, and subtraction.

 


Texture editor

Here you can see texture editor. 

User can drag the image to the page and select a few areas, then crop them and save to texture files that can be used, for example, in object editor.
Main features:
1.  Draggable handles
2.  Intersection control
3Possibility to select and crop multiple areas
Texture editor was developed using jQuery UI JavaScript Library (draggable handles and other UI elements) and jsDraw2D (Graphics Library for JavaScript).

GUI

GUI is being developed using HTML, CSS, jQuery, AJAX. Main idea is to select some instances and drag them to editor.
Content consists of three parts:
1.  Search
2Left menu
3.  Editor field
User can search different instances. Content (types and instances) will be filtered in a real-time by the word typed in search field.
Left menu will contain different types of objects, if you choose some object, first 20 instances of this objects will be shown, if you scroll down, next 20 instances will be shown (AJAX).
After selecting the instance, user can drag and drop it to editor field.

Nov 22, 2012

OSM maps 3-D viewer

        Not much time ago we were visited by Marek Kleciak. You can read about him in OSM wiki.
Marek had a lot of great ideas about improvement of OSM maps, so we decided to make something useful for OSM community.
        For this moment we had presentation of osm maps 3-D viewer. It was a demonstration program of working with osm maps. Some words about its work.
        Open street maps allow to export any desired region of the world to osm-file. We took part of Munchen for rendering. The program shows the ability of building 3-D objects only with 2-D data. For that time program renders only buildings, roads, parks and points of interest (restaurants, cafes).
        Renderer searches tags <landcover>, < landuse> with value forest, grass roads and convert lines in rectangular area and use textures for covering them. Unlike skyscraper, most buildings don't have information about height, so we make it random.
        The program can use 3-D model f.e. Frauenkirche, because the data is in form of nodes that consist of longitude and latitude.






Sep 1, 2012

Using QtDbus

Hello everyone! Our application consists of client and server parts. So for their communication we decided to use IPC(inter-process communication) system – Dbus, specifically QtDbus, because we already are using Qt in our project. To implement QtDbus in project you need to follow several steps:
  1.         Write the class, with slots, signals and properties using custom types.
  2.      Convert this class to xml file using qdbuscpp2xml.
  3.            Generate Adaptor and Interface from your xml file using qdbusxml2cpp.

        qdbusxml2cpp FileName.xml -a AdaptorName

       qdbusxml2cpp FileName.xml -p InterfaceName


After this you need to write your client and server parts. Writing client is pretty simple. You need to  include to client generated interface .cpp and .h files, and create interface that is described in .h file.
For example in our project it looks like


                DriverAssistant::DynamicPoi (SERVICE_NAME, PATH, QDBusConnection::sessionBus());


Now about server part, let’s divide it into simple steps.
  1.         Include generated adaptor .cpp and .h files.
  2.             Include class just like you wrote for generating .xml file with function realization.
  3.             Create an instance of the class and “feed” it to adaptor class constructor.
And don’t forget about adding CONFIG += qdbus in .pro files and #include <QtDBus/QtDBus> in client and server.

P.S. There are not as many examples as it should be, but we recommend you to see this.
Especially "ping-pong" as the smallest and the simplest one.


Aug 17, 2012

Some changes in our project

Our team decided to modify our application to the navigation system, with the ability to display the current location of the machine in real time. Unfortunately, according to the rules of Google Maps service we can no longer continue to use it. In this regard, we turn to use maps service OpenStreetMap. Soon we will publish a video that demonstrates how our application works. Follow the news!