-
Notifications
You must be signed in to change notification settings - Fork 984
Description
Do you want to request a feature or report a bug?
Feature
If this is a feature request, what is motivation or use case for changing the behavior?
Really like the look of AR.js and would like to use it for my (currently) Android-based outdoor navigation app "Hikar" which shows roads and paths from OpenStreetMap as well as virtual signposts in AR.
I'm wondering whether it would make things simpler in these sorts of use-cases which deal with more complex geographical data to use a different projection to store the GPS and feature coordinates.
Rather than setting the origin to the original GPS location and calculating the distance in metres from that origin to each geographical feature, the absolute coordinates of both the current GPS position and the geographical features could be stored in a metre-based projection such as Spherical Mercator (epsg:3857) or others. The projected coordinates could then be directly used as the OpenGL/A-Frame world coordinates.
This would mean that the current camera position would typically be well away from the origin (for example, in Spherical Mercator lat 51.05, lon -0.72 is approximately x = -80000, y = 6600000, giivng a camera position of x=80000, z=-6600000. However as far as I am aware this would not cause problems, and seems to work OK in tests.
Not saying this is definitely the best approach but just my thoughts, having taken this approach with my Hikar app. Using a metre-based projection would also facilitate easy fetching and caching of tiled vector data from an API, such as the 'xyz' based tiling system first popularised by Google Maps and used also in OpenStreetMap.
I have already developed a proof-of-concept version of the gps-camera component in my fork of the repo at
https://github.com/nickw1/AR.js/tree/dev/aframe/src/location-based
See the gps-projected-camera component. It's using Spherical Mercator at present but could potentially use other projections.
For an example of how this could be used in a real project see
https://gitlab.com/nickw1/hikar.org/-/tree/master/webapp
(note, this isn't really working fully yet - though it will in theory overlay the OpenStreetMap data on the AR.js camera feed)