Im using ar.js with aframe to load multiple objects into an a-scene
but instead of seeing the objects where they are supposed to be (according to map coord/latlng), i'm getting all of them towards the same location. For example, I have an a-entity
with latlng values towards south and one more a-entity
with latlng towards north. What happens is that both entities appear on the north or the south side, not where they are supposed to be. Here is my code:
<a-scene
vr-mode-ui="enabled: false"
embedded
arjs='sourceType: webcam; sourceWidth:1280; sourceHeight:960; displayWidth: 1280; displayHeight: 960; debugUIEnabled: false;'>
<a-camera gps-camera rotation-reader far="5000"></a-camera>
<a-entity gltf-model="/path/to/model" rotation="0 180 0" scale="0.70 0.70 0.70" gps-entity-place="<here are values of lat and long towards north>" animation-mixer/>
<a-entity gltf-model="/path/to/model" rotation="0 180 0" scale="0.70 0.70 0.70" gps-entity-place="<here are values of lat and long towards south>" animation-mixer/>
</a-scene>
I believe you need to use gps-projected-camera
instead of gps-camera
within your <a-camera />
element.
You can put they all in the same location and use the position
argument:
for example
<a-scene
vr-mode-ui="enabled: false"
embedded
arjs='sourceType: webcam; sourceWidth:1280; sourceHeight:960; displayWidth: 1280; displayHeight: 960; debugUIEnabled: false;'>
<a-camera gps-camera rotation-reader far="5000"></a-camera>
<a-entity gltf-model="/path/to/model" rotation="0 180 0" scale="0.70 0.70 0.70" gps-entity-place="<here are values of lat and long towards north>" position="3 45 0" animation-mixer/>
<a-entity gltf-model="/path/to/model" rotation="0 180 0" scale="0.70 0.70 0.70" gps-entity-place="<here are values of lat and long towards south>" position="0 45 0" animation-mixer/>
</a-scene>
In my experience sometime if you are fine tuning the position the GPS coordinates may not be very precise. Then it's better to use the same coord for all the object and position them relative to each other.