简体   繁体   English

ar.js 位置基于不放置在坐标

[英]ar.js location based not placing at coordinates

So ar.js has a location based feature where you can place objects at certain coordinates.因此 ar.js 具有基于位置的功能,您可以在其中将对象放置在特定坐标处。 However no matter which coordinates I set it to the 3d object is placed on me, and sticks to me.不过无论我设置哪个坐标,3d object 都放在我身上,粘在我身上。 My GPS may not be extremely accurate but its accurate enough within like a 500 foot radius.我的 GPS 可能不是特别准确,但在 500 英尺半径范围内足够准确。 So it shouldn't show up when I set the coordinates to 0,0.所以当我将坐标设置为 0,0 时它不应该出现。 I have tried it in both firefox and chrome.我在 firefox 和 chrome 上都试过了。 I also downloaded the libraries and stored them locally to get around the CORS issues, however nothing has seemed to fix it.我还下载了这些库并将它们存储在本地以解决 CORS 问题,但似乎没有任何解决办法。

Code:代码:

<html>
<head>
    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <title>GeoAR.js demo</title>
    <script src='https://aframe.io/releases/0.9.2/aframe.min.js'></script>
    <script src="./aframe-ar.min.js"></script>
    <script src="./aframe-extras.loaders.min.js"></script>
</head>

<body style='margin: 0; overflow: hidden;'>
    <a-scene
        vr-mode-ui="enabled: false"
        embedded
        arjs='sourceType: webcam; sourceWidth:1280; sourceHeight:960; displayWidth: 1280; displayHeight: 960; debugUIEnabled: false;'>
        <a-entity gltf-model="./Assets/magnemite/scene.gltf" rotation="0 180 0" scale="0.15 0.15 0.15" gps-entity-place="longitude: 0; latitude: 0;" animation-mixer/>
        <a-camera gps-camera rotation-reader></a-camera>
    </a-scene>
</body>

I've had a similar issue and discovered that I needed to enable location services for my browser app (Safari on IOS).我遇到了类似的问题,发现我需要为我的浏览器应用程序(IOS 上的 Safari)启用定位服务。 That said, I'm still having problems with items following me around a bit so I'm not sure if that's the complete answer (I'm still looking).话虽如此,我仍然对一些跟随我的物品有疑问,所以我不确定这是否是完整的答案(我仍在寻找)。

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

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