Fly through OSM data in Virtual Reality

Hi, I wanted to fly through the world in Virtual Reality and would like to share the result: osm4vr demo - Fly through the world in VR with OSM map data

The project consists of a few components to show OpenStreetMap’s 3d buildings and map tiles inside the browser, especially browsers of VR headsets supporting the A-Frame Javascript library. It ended up very similar to KaiRo’s vrmap from which I’ve taken a lot of inspiration: GitHub - KaiRo-at/vrmap: Virtual Reality Map (WebVR experiment)

A few major differences compared to vrmap:

  • Supports both static geojson assets (e.g. downloads from Overpass API) and loading data dynamically while moving around
  • Components are easy to configure and can be used independently, e.g. to embed just a map or just buildings
  • A search box allows to find a place by name (using nominatim)
  • Handles OSM simple 3d buildings (mostly), so e.g. the Berlin TV tower is more than just a column
  • You can use hand controllers to flap your wings in VR :slight_smile:
  • However, some features are currently missing, e.g. trees are not supported and movement controls are more limited

It’s still quite rough around the edges but may already be interesting for others, so would love your feedback, suggestions or concerns, e.g. regarding its use of OSM services.
The code is at GitHub - ctrlw/osm4vr

I also plan to add links to the OSM wiki pages “3D” and “A-Frame”

5 Likes

Very nice work! :star_struck:

I have added both this and VR Map to the list of 3D OSM viewers at 3D - OpenStreetMap Wiki. Please take a look and confirm if it looks good to you!

I would highly encourage you to try out the other ones listed there in a desktop computer, and experiment with their interaction controls (described in the table).

In particular, it seems like zooming using the scroll wheel would be a particularly uncontroversial addition, as pretty much all the other viewers do it that way, and the gesture isn’t being used for anything in the app at the moment.

Another interaction control that might prove quite convenient (and is also shared by all other viewers) is panning via left-click + dragging. Of course, this would take over the current use of that gesture, which is aiming the view, but that could then switch to use Shift+ right-drag (assuming you’d want to reserve the unmodified right-drag for the “orbit” action, which is also pretty widespread among the others).

WDYT?

Wow, thanks for updating the Wiki and for the suggestions! Improving the controls is high up on my list along with some bugfixes.

1 Like