Qgis2threejs
Qgis2threejs copied to clipboard
How to make AR work in modbile template
I exported a map using the mobile template, then downloaded the resulting map to the browser in my iPhone 6S Plus, running iOS 12.1.4 The map renders as expected, rotates and zooms. When I click the crosshairs I get a popup that gives me location accuracy (eg, 10M). Even though my physical location is within the extent of the map (I can click my location on the map, read the coords, enter them into Google Maps and get back the same location, confirming the position), the map disappears from the screen, just leaving the background. The map has shifted offscreen ( I can get it back by zooming and panning). When I turn on the AR mode (either with the slider or tapping on the map and clicking "start AR here", the browser asks permission to use the camera, I click OK, then the browser region goes black.
What am I doing wrong?
@Llaves you are rendering the template as local file in iPhone? If yes, can you try to test in a webserver with a SSL valid certificate. See QGIS2threejs docs: mobile
I'm serving from a non-SSL website. I'll have to try SSL and see if that makes a difference. Thanks for the hint.
OK, tried via SSL. Same problem. Does the map have to be in some specific CRS before exporting. Mine is in UTM13. I wonder if that's the problem. Does it have to be in something like EPSG:4326?
@Llaves I try to use with EPSG:3857. I saw some examples working.
See: https://kup.my/ucidos/uti3d/Mobile/ https://karta.sorbackensfvo.se/3d/sorbackensfvo/ https://affectivecartographysociety.org/map/mobdemo/mobdem.html
I test this examples only on mobile phone Android. In laptop the browser give me error in method getMedia(). I test the same in a tablet with Windows 10 PRO but give me the same error of the laptop browser. In Windows environments, I change the method depecrated (see #181 ) and in the tablet, we recognize de cameras.
@minorua can you explain what we are doing wrong?
@jonnyforestGIS @minorua I reset my map to EPSG:3857 and saved the 3D map. Uploaded to web server (new directory to avoid any caching issues on browser). Still having the same problem. Map downloads fine to browser, but when I turn on GPS and move to current location, I'm way off the map, though I should be in the center.
@Llaves strange. In my case location works fine e put everything in the same projection. s your project on-the-fly or everything is in the same projection? If no, try to use the all project in EPSG:4326. (I don't know if you test this already). Can this be the problem?
@johhyforestGIS - my map is in UTM13 - EPSG:26913. To try you idea I exported the layers to EPSG:4326 and re-created the map with everything in that CRS. When I open the 3D plug-in I get nonsense - a seemingly infinite tall spike that presumably has my terrain on the top but I can't even find the top.
@Llaves sorry for my delay. This happens because of geographic projection I guess EPSG:4326. If you use ESPG:3857 that is a project I think this problem disappears. Did you find what was the problem of AR mode?
@jonnyforestGIS - no, I've never gotten it to work on my iPhone. Map shows fine, but the GPS position has large errors.
@Llaves sorry for my delay. Things are working with a test a did. At this time the thing that I can't put to work is the AR using the camera. The browser shows me that the camera is being used but don't blend in the scenario. Probably because of the height I need to check. Did you have any kind of progress?
I am still unable to get this to work on my iPhone. I can't even get the position right, let alone the link to the camera in AR mode
@Llaves check this link https://get.webgl.org/ What is your test browser? Safari, chrome or other? Do you have the same behaviour in the three? It's possible to test you project?
I"m using the default safari browser on iOS 13. It passes the test. I haven't tried the other browsers. I suppose I should.