igorbrejc.net http://igorbrejc.net Just another developer's weblog Fri, 01 Aug 2008 19:27:54 +0000 http://wordpress.org/?v=2.3.1 en Status Update On Kosmos http://igorbrejc.net/uncategorized/status-update-on-kosmos http://igorbrejc.net/uncategorized/status-update-on-kosmos#comments Fri, 01 Aug 2008 19:25:43 +0000 breki http://igorbrejc.net/uncategorized/status-update-on-kosmos I decided to take my time and study the literature on 3D rendering, especially on maths (vertices, matrices, transformations…), which I forgot all about since my student days. I can highly recommend the 3D Math Primer for Graphics and Game Development book which (contrary to many math books for developers) covers not just mathematical equations and theory, but also tries to explain this in a way more familiar to developers.

I abandoned the approach of continuing working on the cannibalized code from Mini 3D Terrain Viewer simply because there were too many problems which I didn’t know how to solve easily. Anyway, I think the skipping over basic stuff like 3D maths and DirectX is not very wise - sooner or later the things you neglected come to haunt you.

I started posting current results of my effort on flickr - this will be a sort of a snapshot history of Kosmos WorldFlier from the day one, step by step. Not much to see yet - I managed to render all OSM ways as 3D lines, you can see the Isle of Wight there. This is just a temporary solution - road should be rendered as mashes, but that will come later. Right now I’m working on the camera navigation stuff.

I’m still using DirectX managed SDK for this. I decided to implement the inital version with this SDK simply because I already have some limited experience with it - I didn’t want to make this harder by introducing some other SDK which I haven’t worked with yet. Later, I’ll probably migrate the code to use some other library (there are several options: OpenTK, Irrlicht or something else).

]]>
http://igorbrejc.net/uncategorized/status-update-on-kosmos/feed
Kosmos WorldFlier - New Screenshots http://igorbrejc.net/openstreetmap/kosmos-worldflier-new-screenshots http://igorbrejc.net/openstreetmap/kosmos-worldflier-new-screenshots#comments Wed, 23 Jul 2008 20:32:05 +0000 breki http://igorbrejc.net/openstreetmap/kosmos-worldflier-new-screenshots I uploaded some new screenshots of WorldFlier to flickr.com, this time of Mount Etna. The work on WorldFlier is progressing, but there are still a lot of things to fix - relief still doesn’t exactly match the contours (well it is a prototype after all).

 

The screenshots show WorldFlier and Kosmos GUI - what you set in Kosmos GUI to be visible will be displayed in the 3D. So first I generated a elevation coloring map and then I used Landsat’s satellite images.

No OpenStreetMap data this time - there were some changes in OSMXAPI that prevented me from downloading the latest data.

]]>
http://igorbrejc.net/openstreetmap/kosmos-worldflier-new-screenshots/feed
Kosmos Featured On Golem.de http://igorbrejc.net/openstreetmap/kosmos-featured-on-golemde http://igorbrejc.net/openstreetmap/kosmos-featured-on-golemde#comments Wed, 23 Jul 2008 17:33:24 +0000 breki http://igorbrejc.net/openstreetmap/kosmos-featured-on-golemde Kosmos is today featured on the German IT-news portal golem.de. The article presents the Kosmos application and also features screenshots and a video I recorded few days ago of the upcoming WorldFlier 3D rendering addition to the Kosmos.

This is the second article about Kosmos on golem.de. The first one was published in January.

]]>
http://igorbrejc.net/openstreetmap/kosmos-featured-on-golemde/feed
OpenStreetMap 3D - Short Video http://igorbrejc.net/openstreetmap/openstreetmap-3d-short-video http://igorbrejc.net/openstreetmap/openstreetmap-3d-short-video#comments Fri, 18 Jul 2008 21:35:34 +0000 breki http://igorbrejc.net/openstreetmap/openstreetmap-3d-short-video I uploaded a short video of the OSM 3D rendering in action:

Now I go to bed :)

]]>
http://igorbrejc.net/openstreetmap/openstreetmap-3d-short-video/feed
Kosmos 2.1 http://igorbrejc.net/openstreetmap/kosmos-21 http://igorbrejc.net/openstreetmap/kosmos-21#comments Fri, 18 Jul 2008 20:12:41 +0000 breki http://igorbrejc.net/openstreetmap/kosmos-21 New version of Kosmos is here. Since I’ve neglected the rendering engine during the implementation of 2.0 release, I decided to do most of the work for this release on improving the rendering.

You can download the 2.1 version from the standard place: http://downloads.igorbrejc.net/osm/kosmos/

UPDATE (July 19th): I discovered a small bug in the new release - generated contours were not shown on the map. This has been fixed now, please download a new package.

So what has been improved?

Relations

Kosmos can now render relations. I’ve added a sample rule in general purpose rules Wiki page for rendering cycle routes:

Rule Name Targets Selector Template Options Comment
RouteCycle relation type=route route=bicycle Polyline (MinZoom=7, Color=#50FF0718, Width=7:1;17:18, Curved=true)

will produce a pinkish half-transparent cycle route:

image

Note that rules ignore roles of members in a relation - currently I don’t see how the roles could be incorporated into the rendering rules.

Text Rendering

There is a new TextMode called WayCenter which draws the text (roughly) in the center of a way:

image

There are also two new parameters which enable rendering of outlined text: OutlineColor and OutlineWidth, example (sorry for the odd formatting):

PlaceTown node place=town Text (MinZoom=10, MaxZoom=15, Color=black, TagToUse=name, FontName=Trebuchet MS, FontStyle=bold, FontSize=10:10;17:25, OutlineColor=white, OutlineWidth=20%)

will produce something like this:

image

Kosmos now knows how to wrap labels:

image

The wrapping is done using the "Text label wrap factor" preferences setting. It is a ratio of (roughly) maximum line length compared to the line height. Normal values are somewhere from 4 to 10, I guess.

Map Scale Indicator

… is now shown on the map:

image

You can turn it off. You can also switch from metric to U.S. Customary units in Preferences dialog ("Use metric units").

Rendering Engine Speed-Up

I’ve refactored quite a large piece of rendering engine code to increase the rendering speed and lower the memory consumption. Basically, in previous versions each rendered map element had all its settings (color name, width, …) stored by itself. Now the settings shared by multiple elements are stored in one place (a "style"). This also allows caching of GDI+ objects for each style without the need to recreate them for each map element.

There are also a number of bugfixes in this release (basically every bug that was reported has been fixed).

Source Code

I’ve also published the sources here: http://downloads.igorbrejc.net/osm/kosmos/source/ . I’ll prepare a special Wiki page with some information about the source code and what one can and what one cannot expect from it. So please be patient before starting to send me hate notes about not being able to compile the source code ;)

]]>
http://igorbrejc.net/openstreetmap/kosmos-21/feed relation image image node image image image
OpenStreetMap In 3D http://igorbrejc.net/openstreetmap/openstreetmap-in-3d http://igorbrejc.net/openstreetmap/openstreetmap-in-3d#comments Thu, 17 Jul 2008 19:10:10 +0000 breki http://igorbrejc.net/openstreetmap/openstreetmap-in-3d Well Google Earth it is not ;).

A long time ago I mentioned I’ve been dreaming about drawing OpenStreetMap maps in 3D. Well for past few days I’ve been playing around with DirectX. Basically I took Mini 3D Terrain Viewer tool kindly provided by Patrick Murris and did some cannibalising of the code to make it draw a SRTM3 generated relief with an Kosmos-exported map of my home town Maribor (OSM map).

Here are some screenshots of the results so far (you can download somewhat larger versions of images from here).

Image1 Image2 Image3 Image4 Image5

The images are reduced from 1680×1000 resolution due to bandwidth constraints. The Kosmos-exported map which was used as a texture has a resolution of around 8000×8000 pixels (elevation contours are a part of that image and not rendered as 3D objects themselves). The whole thing was rendered on a GeForce 7600 GS.

This is just a crude prototype of 3D rendering which I want to introduce into Kosmos in the future. My wish is to draw OSM elements directly in 3D and not as part of a texture, but since I’m not an expert on DirectX, this could take a while (any helpful suggestions from 3D experts will be appreciated). But even in this crude state I think it looks quite nice, don’t you think?

]]>
http://igorbrejc.net/openstreetmap/openstreetmap-in-3d/feed Image1 Image2 Image3 Image4 Image5
Kosmos - What Comes Next http://igorbrejc.net/openstreetmap/kosmos-what-comes-next http://igorbrejc.net/openstreetmap/kosmos-what-comes-next#comments Fri, 11 Jul 2008 18:21:24 +0000 breki http://igorbrejc.net/openstreetmap/kosmos-what-comes-next It has been a few days since Kosmos 2.0 version has been released. Other than initial reports with problems running Kosmos on non-English version of Windows, I haven’t received any other bug reports - is it because it works so perfectly or that there are just too much bugs to report? Just kidding :)

Anyway, now that I have finished most of the work on the GUI redesign, I can concentrate on improving the rendering engine, which I mostly neglected during the past months. A few days ago I implemented support for rendering relations (yes, you can now render cycle ways similarly to the CycleMap). I also added the ability to render outlined text - this has been lying on my todo list for a long time.

While implementing these features I accidentally had a “bright” idea on how to reduce the memory footprint of rendering objects in Kosmos and also (hopefully) increase the speed of rendering.  Right now I’m about half-done, I’ll probably need a few days more to finish it. So Kosmos 2.1 is coming soon…

]]>
http://igorbrejc.net/openstreetmap/kosmos-what-comes-next/feed
Kosmos 2.0 - "Illegal Hotkey" Fix http://igorbrejc.net/openstreetmap/kosmos/kosmos-20-illegal-hotkey-fix http://igorbrejc.net/openstreetmap/kosmos/kosmos-20-illegal-hotkey-fix#comments Tue, 08 Jul 2008 15:36:08 +0000 breki http://igorbrejc.net/uncategorized/kosmos-20-illegal-hotkey-fix Yesterday I had a few reports that Kosmos GUI breaks down right at the start, reporting “System.ArgumentException: Illegal hotkey ‘Ctrl+N’.” error. I could not reproduce this problem, but I think it occurs only on non-English Windows, probably because the Microsoft code I used to parse hotkeys expects different forms of hotkeys for different languages. I tried to change the UI culture for the application and test if the error occurs then, but to no avail.

I decided to fix this by implementing my own parsing logic for hotkeys. Again, I could not test if this now works for non-English Windows. So please download the latest package (2.0.508.0) and let me know if this problem is solved.

]]>
http://igorbrejc.net/openstreetmap/kosmos/kosmos-20-illegal-hotkey-fix/feed
Kosmos 2.0 Is Here At Last http://igorbrejc.net/openstreetmap/kosmos-20-is-here-at-last http://igorbrejc.net/openstreetmap/kosmos-20-is-here-at-last#comments Mon, 07 Jul 2008 19:23:53 +0000 breki http://igorbrejc.net/openstreetmap/kosmos-20-is-here-at-last After almost 5 months of development, I can now announce that I’ve just released a new version of Kosmos. I’ve talked about it several times, although my blog posts have been reduced to practically zero - I’ve been so busy with Kosmos that I just didn’t find the time to write.

NOTE: before proceeding I should warn you that I consider this release to be in beta stage. I spent the last month killing bugs in Kosmos, but since a lot of new functionality was added there are bound to be quite a few bugs still lurking around. If/when you encounter them, please report them on the Kosmos OSM Wiki talk page.

Download

You can download the latest version from here. I’ll be also publishing the source code in the next few days.

So what’s new?

Tabbed Document Interface

First of all, the GUI interface has been completely rewritten. Kosmos GUI now uses an tabbed document interface (TDI):

image

As you can see from the screenshot, the user interface is somewhat reminiscent of Visual Studio. You have a Project Explorer through which you can edit the project file. There is the Properties window which displays properties of the currently selected project or data file. There is also the Activity Logger window which shows the activity Kosmos is performing.

Of course, there is the Map window with the familiar Kosmos-rendered OSM map. You can also look for new maps using the Web Map window which is able to display most common Web maps (OSM, Google, Yahoo, Microsoft).

Downloading OSM Data

Kosmos can now download the OSM map data from the OSMXAPI server. So in theory you can now generate a map without any additional tools. Be warned though: OSMXAPI can be quite slow sometimes, especially if you choose to download large map areas.

GPX Support

Kosmos now has the ability to download GPS data from a GPS unit and display it on the map. You just need to have gpsbabel software downloaded and saved somewhere on the disk.

Relief Contours

I integrated the Srtm2Osm tool into Kosmos GUI so that users can generate relief contours for any map area:

image

Imagery From Landsat And openaerialmap.org

Another nice feature in Kosmos 2.0 is the ability to download free satellite imagery from Landsat and openaerialmap.org sites:

image

Tile Server

The tile server (launched from the Kosmos Console) is now able to render all of the data specified in the project file. This means that you can now render tiles which contain shaded reliefs, satellite imagery, GPX tracks, elevation contours.

Other Stuff

There are lot of other improvements which I will describe on the Kosmos OSM Wiki pages in the next days.

What’s Missing

This is not the end of Kosmos development, far from it. I still have quite a few ideas I want to introduce into Kosmos. I realize that a lot of things are still missing - I have a “to do” list that is growing day by day. Hopefully future releases will have even more cool features. So be patient… And do send me some feedback, critiques and ideas :)

]]>
http://igorbrejc.net/openstreetmap/kosmos-20-is-here-at-last/feed image image image
Kosmos 2.0: First Screenshot http://igorbrejc.net/openstreetmap/kosmos-20-first-screenshot http://igorbrejc.net/openstreetmap/kosmos-20-first-screenshot#comments Sun, 01 Jun 2008 08:34:16 +0000 breki http://igorbrejc.net/openstreetmap/kosmos-20-first-screenshot I haven’t been posting anything for at least a month. The reason is that I’ve been quite busy with the development of the new version of Kosmos.

I’m happy to announce that the development is in its final stages. Most of the new features that I’ve planned for Kosmos 2.0 have been finished, now I’m mainly working on bugfixing and final touches. I expect the first release to be sometime this month (June).

Since I haven’t released any new stuff in months, today I decided to at least publish the first screenshot of the new user interface:

Kosmos2.0

As you can see, Kosmos 2.0 uses the tabbed document interface (TDI). On the left you can see the Project Explorer window, which can now be used to edit the project - no more manual text-editing of XML files. Notice the project tree view now supports showing of GPX files (which can now be downloaded directly form the GPS unit) and elevation contours (which can be generated inside the Kosmos GUI). On the bottom is the logging window, which can be used to track what Kosmos is doing. TDI itself if fully configurable, so you can move, resize or hide windows any way you like.

You can track the progress of the development on the Kosmos OSM wiki page.

]]>
http://igorbrejc.net/openstreetmap/kosmos-20-first-screenshot/feed Kosmos2.0