繁体   English   中英

基于位置的跟踪的 ar.js/Aframe 多个对象无法正常工作

[英]ar.js/Aframe multiple objects on location based tracking not working properly

我使用带有aframear.js将多个对象加载到一个a-scene ,但是我没有看到它们应该在的位置(根据地图 coord/latlng),而是让它们都指向同一个位置。 例如,我有一个 latlng 值朝南的 a- a-entity ,还有一个 latlng 朝北a-entity 发生的情况是两个实体都出现在北侧或南侧,而不是它们应该在的地方。 这是我的代码:

    <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>

我相信您需要在<a-camera />元素中使用gps-projected-camera而不是gps-camera

您可以将它们都放在同一个位置并使用position参数:例如

    <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>

根据我的经验,有时如果您微调位置,GPS 坐标可能不是很精确。 那么最好对所有对象使用相同的坐标并将它们相对于彼此定位。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM