mattrei / aframe-tangram-component

Use Mapzen's Tangram Maps within A-Frame
https://mattrei.github.com/aframe-tangram-component
MIT License
17 stars 1 forks source link

active? #1

Closed morandd closed 7 years ago

morandd commented 7 years ago

is this active?

I think there will be huge interest in being able to serve streaming map tiles into AFrame. Google Earth VR does not support KML so we in open source will need to create an alternative. Cesium is the only other way currently, but they have a very weak WebVR implementation.

mattrei commented 7 years ago

Hi, thx for your interest. I did not touch the code within the last months, however as there is interest I will document the current status and polish the code within the next days. It runs (as you may see in the examples) and Tangram is indeed a nice library that can be used for 3d terrains. However my tests showed me that are some limiting restrictions. ThreeJS does not support texture tiling, so you can only use a specific area size (and not an endless one), so we would need some algorithm that fetches all those things on demand. It similar to the aframe-terrain-model-component however that everything is done automatically (if you provide a tile map server of course).

Recently I have found this project: https://github.com/iTowns/itowns2 which is kind of a Cesium in ThreeJS. However talking to the guys, they do not support the integration in custom threejs scenes so far.

Anyway I will publish this component soon, because its a nice thing to show what can be achived within Aframe.

morandd commented 7 years ago

Another one is https://github.com/UDST/vizicities/ That project seems to have libraries in place for building a slippy map tile layer out of THREE.PlaneGeometry objects and streamed raster tiles.

I read your discussion with iTowns. That's a pity that it's so much work to convert their globe into a modular component.

So there's still a big gap between what's available today and a simple leaflet.js replacement that offers a tiled 3d globe in WebVR. I note this does exist for Unity, in the globe asset by Kronnect.me. That allows custom TMS servers, and also a cool 'inverted globe' mode for VR, so you are looking out from the center of the world, (a la Professor X's Cerebro). I was hoping something like that could be done in AFrame.

morandd commented 7 years ago

note: https://stackoverflow.com/questions/26087620/three-js-tile-which-has-multiple-textures-using-plane-geometry

mattrei commented 7 years ago

yeah i also have looked into that, but I think it would not work for our use case. Mapbox did it as well with Three.JS recently in a demo and the build small geometries and texture them. Thats the way to go and easy to implement, i think. But currently I try to release its current state, as soon as I find some time.

morandd commented 7 years ago

build small geometries and texture them. yeah that sounds like the right approach but then you need to manage the tiles yourself... aka re-implement Leaflet... which is too rich for my blood I'm afraid :) but I'm hoping someone does this at some point. Getting TMS tiled maps into THREE is basically allows the open source version of Google Earth VR. I wrote to Cesium also about their 3d/vr ambitions, they said they are aware of the desire but have no active work on that.

mattrei commented 7 years ago

no i don't not think you have to reimplement Leaflet. We make use of Leaflet tile-fetching, as I do now. I just specifiy the size of the geometry and the rest gets done by Tangram (which uses Leaflet in their core). However there needs to be just some mangement with the viewing frustum of the ThreeJS Scene. That means some position logic where you "are" on the map and which direction you are going to build the geometry. Some memory pooling for this is already in A-Frame.

See what Mapbox has been done: https://blog.mapbox.com/bringing-3d-terrain-to-the-browser-with-three-js-410068138357

It slow and feels heavey, however I think this is the simplest solution we can get. I am currently travelling in Africa and can work on that mid of September. However the solution won't be as good as real proper fetching of Tiles and Geometries like a 3D Leaflet of course. Google VR is unreachable by that means...

mattrei commented 7 years ago

and forget about Cesium, because it is impossible to integrate their renderer within ThreeJS renderer. And we need a solution for A-Frame.

mattrei commented 7 years ago

just released a 2D version from it.

Will create ASAP a aframe-tangram-terrain-component.