Inspiration

We were looking for a different Augmented Reality use case, something that became a challenge. Placing geo-localization markers in a 3D model was it, as we have never seen that before. Also, it was a way to mix already know-how skills, like OpenGL and fetching POIs from a service.

What it does

Display a real world 3D map model with real world Points of Interest on it, in an Augmented Reality application. The app displays a portion of Rome with some coffee places around it.

How we built it

  • 1st, we download a 3D model map from Open Street Maps.
  • Then, that model (.osm) was transformed to .obj using OSM2World tool.
  • That obj file was cleaned using Blender (removing some weird polygons, changing some colors).
  • Then, the obj model is imported to the android studio project via sceneform tool.
  • To be able to translate gps positions to the 3D environment, some Map data needs to be set: - Map center. You can find that info in your .osm file, element bounds.
    • Scale: Check the generated .sfa file. Look for model -> scale
    • ReferencePoint: This is a tricky one. Basically, we need a known point in the model to associate with a gps coordinate. In the example, we know that one corner of the Coliseum, with lat=41.89007, lon=12.49344 is in the vertex 235.84084f, -197.85388f (altitude not used). This info allow as to performa simple coordinates extrapolation, that it's good enough for a small map portion with not much high differences.
  • Then, scenform and arcore do the rest.

Challenges we ran into

  • Map geo location to OpenGL vertex position was the main challenge. Also, we had some issues with the exported obj files (like missing roofs and weird lines).
  • The frame rate is a problem with big maps.

Accomplishments that we're proud of

The main accomplish was to actually make it work :).

Also, we took care about the project architecture. The idea is to make it easy to change models, POIs sources, etc. We implemented a "Clean Architecture" with reactivex, dependency injection.

What we learned

All the tools used (arcore, sceneform), and a little of Blender.

What's next for AR 3D POIs Android

The project should be converted in a library, and make it easier to integrate in any project. The map data definition is not the best, that should be improved. With bigger ambitions, it would be nice have something like "3D map tiles", and load them on demand, so the user could move the map. Other possible features:

  • User interaction to show/hide POIs info detail.
  • Search other type of POIs.

Built With

Share this project:
×

Updates